Can he do Hajj on behalf of someone who did not pray?
Another thing: does Hajj removes all the sins of the performer (pilgrim) even not praying?.
The fact that you refer to “the sin of not praying” twice indicates that you think that not praying is a grave sin before Allaah, and this is indeed the case. The scholars differed concerning the level of kufr of the one who does not pray; the correct view is that he is a kaafir who is beyond the pale of Islam. The evidence for that is as follows:
1 – It was narrated from ‘Abd-Allaah ibn Buraydah that his father said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “The covenant that distinguishes between us and them is prayer; whoever does not pray is guilty of kufr.”
Narrated by al-Tirmidhi, 2545; al-Nasaa’i, 459; Ibn Maajah, 1069. Classed as saheeh by al-Albaani in Saheeh al-Tirmidhi, 2113.
2 – It was narrated that Abu Sufyaan said: I heard Jaabir say: I heard the Prophet (peace and blessings of Allaah be upon him) say: “Between a man and shirk and kufr there stands his giving up prayer.”
Narrated by Muslim, 116.
The Sahaabah are agreed that the one who does not pray is to be regarded as a kaafir, and this was the view of the scholars who came after them such as ‘Abd-Allaah ibn Shaqeeq, Ibraaheem al-Nakha’i, Ishaaq ibn Raahawayh, Ahmad ibn Hanbal, ‘Abd-Allaah ibn al-Mubaarak, al-Hakam ibn ‘Uyaynah, and others.
Prayer is the first thing concerning which a person will be asked on the Day of Resurrection. If his prayer is sound then all his deeds will be sound, but if it is not good then none of his deeds will be good.
The one who does not pray will not benefit from any of his deeds, rather all his deeds will be in vain. Allaah says of the kuffaar (interpretation of the meaning):
“And We shall turn to whatever deeds they (disbelievers, polytheists, sinners) did, and We shall make such deeds as scattered floating particles of dust”
“And indeed it has been revealed to you (O Muhammad), as it was to those (Allaah’s Messengers) before you: “If you join others in worship with Allaah, (then) surely, (all) your deeds will be in vain”
And the Prophet (peace and blessings of Allaah be upon him) said: “Whoever fails to pray ‘Asr, all his deeds are in vain.”
Narrated by al-Bukhaari, 553.
Based on this, if a person who does not pray performs Hajj, and he persists in not praying, then his Hajj is not valid and nothing will expiate for his sin of not praying. Similarly, if he dies whilst he is persisting in not praying, he will not benefit after death from any good deeds that are done on his behalf after he has passed away. It is not permissible for anyone who knows that he died whilst persisting in not praying to pray for forgiveness or mercy for him or to perform Hajj on his behalf, because he is a kaafir and mushrik, and Allaah says (interpretation of the meaning):
“It is not (proper) for the Prophet and those who believe to ask Allaah’s forgiveness for the Mushrikoon, even though they be of kin, after it has become clear to them that they are the dwellers of the Fire (because they died in a state of disbelief)”
But if the one who does not pray repents and starts to pray regularly, and regrets what he did, and comes back to Islam, then Allaah will forgive him all his past sins.
Allaah says (interpretation of the meaning):
“Say to those who have disbelieved, if they cease (from disbelief), their past will be forgiven”
The phrase “if they cease” means, if they cease being disbelievers by submitting to Allaah alone with no partner or associate. (Tafseer al-Sa’di)
And the Prophet (peace and blessings of Allaah be upon him) said: “Islam erases what came before it (i.e., of sins).”
(Narrated by Muslim, 121).
And Allaah knows best.