Haj on behalf of others
Performance of those acts of worship (Fardh or Wajib) that Allah (Subhanahu Wa Ta'ala) has decreed on His slaves is compulsory and necessary for everybody. Through the Fardh, Wajib, charity and sacrifice, a human being gains closeness with Allah (Subhanahu Wa Ta'ala) ( Qurb ).
Thus, if anybody performs an act of worship, whether it is worship through the body or through money or wealth, the reward of that worship can be gifted to others and this is perfectly permissible in the light of the Hadith.
It is mentioned in the Hadith that when the reward of optional charity, Haj or other virtuous acts is gifted to the deceased, it reaches them and they become happy on receiving it.
Translation of Hadith: It has been narrated on the authority of Hadhrat Anas (May Allah be well pleased with him), he said the Holy Prophet (Sallallahu alaihi wa sallam): O Prophet of Allah (Sallallahu alaihi wa sallam), we give charity on behalf of our deceased, perform Haj for them and pray for them. Does the reward of this reach them? The Holy Prophet (Sallallahu alaihi wa sallam) said: Yes, indeed this reward reaches them and they become happy on it they way anyone among you becomes happy on receiving a tray full of gifts.
The greatest Fuqaha (Islamic Law Experts) have mentioned this Hadith in their works:
Imam Ibn Hamam in "Fath Ul Qadeer", Vol. 3, Pg No. 133.
Imam Zaila'i in "Tabyeen Ul Haqaaiq" Vol.2, Pg No. 420.
Imam Ibn Abideen Shaami in Raddul Muhtaar, Vol. 2, Pg No. 257.
This Hadith is also given in "Mausu'a Fiqhiya Kuwaitiya, Harf Ul Taa" and Fatawa Darul Ifta Al Misriyya
It is given in Manasik Mulla Ali Qari Ma'a Haashiya Irshad Us Saari, Pg No. 475:
Translation: Remember this principle that it is allowed for a person to gift the reward of his/her worship, regardless of whether that person has passed away or is alive be it Haj, Salaat, fasts, charity, recitation of the Holy Quran or any other recitations.
When a person performs a good act and gifts the reward to anybody else, this act is permissible as per the Ahle Sunnah.
The way gifting the reward of good acts to those who are alive is correct, in the same way, it is correct when gifted to the deceased. If any person performs Haj on behalf of any person of their family, then Allah willing, the reward of that Haj will surely go that person.