A person can escape punishment of sin if due prAyascitta is done as per dharma sAstra or if he is a Self realized person or if he unconditionally surrenders to KrshNa.
If the gravity of the Sin is so powerful the entire generation can get affected. It has to be kept in mind that a person who has to experience the agony based on his sins alone would be born as son and hence it gets transmitted to the right person only. There is no discrimination.
RAjA shares the sins of his citizens, RAja purohita shares the sins of the RAjA. The husband shares the sins of his wife. Guru shares the sins of his disciples. The pApa done by a self -realized person gets distributed to his critics and the PunYa to his followers.