Dr. Muzammil Siddiqi, former president of the Islamic Society of North America, states the following:
“If the deceased parents made a will before their death, left the necessary money for Hajj and asked their children to make Hajj on their behalf, then the children must make Hajj, either themselves or should send someone to make Hajj, on behalf of their dead parents.
However, if the parents did not make a will, but children wish to make Hajj on behalf of their parents they are permitted to do so. Those children will receive the reward and also the reward will be for their parents, Insha Allah.
There is nothing wrong, as far as Islam is concerned, in making Du`aa or performing Hajj on behalf of the parents who were neglectful in their religious duties, as long as they died Muslims. The children should pray for their parents and should ask Allah to forgive them. It stands to reason that all Muslims should try their best to live by Allah’s Rules, but we are all neglectful, some more and some less.
We should pray for those who passed away as Muslims, and we should urge our children and others to do that for us when we leave this world.”