Answer
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
Authentic traditions tell us that many prophets performed hajj.
Answering your question, Dr. Muhammad Salama, PhD, Islamic Studies in English, Associate Professor at the Faculty of Islamic Sciences al-Madinah International University (Mediu), states:
As this issue belongs to the realm of the unseen past, the only way we can know about it is through divine revelation; that is, the Quran and the Sunnah.
In one narration, Ibn Abbas reported that the Messenger of Allah (peace be upon him) passed through the valley of Aal-Azraq, and he asked, “Which valley is this? They said, “This is the valley of Al-Azraq.” He said, “[I feel] as if I am seeing Moses (peace be upon him) coming down from the mountain track and calling upon Allah loudly (saying: Here I am at your service!).” Then he came to the mountain track of Harsha and said, “Which mountain track is this?” They said, “It is the mountain track of Harsha.” He said, “[I feel] as if I am seeing Jonah (peace be upon him) son of Matta on a well-built red dromedary, with a cloak of wool around him and the rein of his dromedary is made of the fibers of date-palm, and he is calling upon Allah (saying: Here I am at your service, my Lord!.” (Muslim)
In another hadith, the Messenger (peace be upon him) is reported to have said, “Seventy prophets, including Moses, prayed in the Khayf Mosque [in Mecca].” (Al-Tabarani)
Even prophet Jesus (peace be upon him) will perform Hajj and/or Umrah by the end of time as reported by Abu Hurairah (may Allah be pleased with him) that the Messenger of Allah (peace be upon him) said, “By Him in Whose Hand my soul is, Ibn Maryam (Jesus) will certainly pronounce talbiyah for Hajj or for Umrah or for both in the valley of Rauha.” (Muslim)
These are the authentic texts we have in this regard and we thus have to believe in them.
Almighty Allah knows best.