A person who goes to the Hajj returns with all his sins forgiven.
The Prophet (may peace be upon him) said, ” He who performs Hajj and neither spoke indecently not did he act wickedly would return free of sin as on the (very first) day his mother born him. ” (Al-Bukhari : Ch. Hajj : 1650
Muslim : Ch. Hajj : 2403)
Muslims believe that it is possible to perform the Hajj on behalf of someone else. Islam teaches that whoever is able to perform Hajj and then something detains him from performing it, whether illness or old age, should charge someone to perform Hajj on his behalf.
The Prophet allowed a person to perform the Hajj on behalf of another person.
Al-Fadl bin `Abbas reported that a woman from Khath`am said to the Prophet (peace be upon him), “O Messenger of Allah! The rite of Hajj which Allah ordained upon His servants has become obligatory upon my father, but he is too old to ride a camel. May I perform Hajj on his behalf?” He answered, “Yes.” (Al-Bukhari : Ch. Hajj : 1417, 1721, 1722 Muslim : Ch. Hajj : 2375, 2376)
This means that it is possible for the actions of one person to result in the forgiveness of sin of another person.
In Christianity we have a similar concept. That is the concept of atonement. We believe that what Jesus has done for us is able to benefit us. The benefit is the same as the benefit of Hajj. The benefit is to erase all our sins.