It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that a man asked the Prophet (peace and blessings be upon him): O Messenger of Allah, shall I perform Hajj on behalf of my father? He (peace and blessings be upon him) said: "Yes; even if it does not benefit him, it will not harm him."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 12953