In his famous book Fiqh-us-Sunnah, the late Egyptian scholar Sheikh Sayyed Sabiq, may Allah bless his soul, states: “Whoever performs Hajj out of unlawfully gained money may be technically absolved of the obligation of Hajj, but according to the majority of scholars he or she is regarded as committing a sin by doing so. However, Imam Ahmad is of the view that such a Hajj is invalid and cannot absolve the person of his or her prescribed obligation.
The opinion of Imam Ahmad is believed to be the most correct because the authentic hadith states: “Surely, Allah is Good, and He does not accept anything but what is good.”
Abu Hurayrah (may Allah be pleased with him) also reported that the Prophet (peace and blessings be upon him) said: “As soon as a pilgrim sets out for Hajj with a provision earned by lawful means, and puts his (or her) foot in the stirrup (i.e. rides his mount to start the journey) and calls out: ‘O Allah! Here I am in response to Your call,’ an announcer answers him from Heaven: ‘Your call has been answered; how lucky you are: your provision is lawful, your mount is lawful, your Hajj is accepted and it will remove your sins.’ But, if he (or she) sets out with a provision unlawfully gained, and he (or she) puts his (or her) foot in the stirrup and calls out: ‘O Allah! Here I am in response to Your call,’ an announcer from Heaven answers him (or her) back: ‘Your call is not accepted; how unlucky you are: your provision is unlawful, your Hajj is not accepted and it will not remove your sins.”
Al-Mundhri says: “This Hadith is reported by At-Tabaraani in his book Al-Awsat.”