AbdulWausay asks about gifting reward of actions to others:
Just like we can give charity on behalf of our parents; is it possible to give charity or go on hajj with the intention of doing it on the behalf of a friend or anyone who isn’t your parent?
Answer:
When we look to discussions in the tradition about gifting the reward of one’s actions to others, we find a variance of opinion. A minority (labeled by some as innovators) denied any type of benefit. This opinion is an erroneous, due to it contradicting clear texts.
Amongst the Fuqaha, there are two opinions. Some scholars (namely the Malikis and Shafis) differentiated between verbal, physical, and financial acts, pronouncing some acts as beneficial when gifted to another, and others not.
Additionally, He – Alaihi al-Salam- mentioned that “When one of you dies his actions are cut off, except for three…” meaning his statements and physical actions are no longer existent, but that the reward from others actions carried on because of you are continuous “… perpetual charity, or beneficial knowledge, or a righteous child supplicating for you.”
For the living, if a group of people share in a sacrificial animal, yet only one of them physically sacrifices it, they will all be rewarded. For Udhiyyah, the Messenger sacrificed two large rams, the first saying at sacrfice “This is for Muhammad and the family of Muhammad” and for the second “This is for the Ummah of Muhammad.” Narrated by Ahmad in the Musnad.
So in short, gifting the reward of any good deed you do with the intention of benefiting someone else will benefit them. However, if you have not made Hajj for yourself, you must make Hajj for yourself first, then you can make Hajj for anyone else you wish.
And Allah knows best.