He did not dress like a muslim as some people try to portray, Guru Sahib Ji dressed as a holy man, which meant a chola or garb of khuddar, rough low grade material, and a pair of wooden sandals or Kharama. On his travels Guru Sahib Ji did travelled westwards, but never to a Hajj.
This is a very important point as many people say that only muslims are allowed to go to Mecca / Madina and Guru Ji would have been barred from entering. Here is an excerpt from a document about the Mughal-ottoman relations during the reign of Akbar :
An early document state that:
'No Muslims and believers in the unity of God', proclaims an Ottoman
imperial firman, 'should be hindered in any way if he wishes to visit
the Holy Cities and circumambulate the luminous Ka'ba.'42
42. M.D., vol. 6, f. 17, firman no. 39, 1564-5, quoted by Faroqhi, op. cit. 147.
Notice there not a distinction between muslims and non-muslim monotheists. One of the 4 sunni schools also say that only polytheists (idol worshippers) are banned from the city of Mecca. In the Hanafi school, it is permitted for non-Muslims to enter all mosques, including the Haram of Mecca, as they interpreted the Quranic verse,
“ 009.028 O’you who believe! The idolaters only are unclean. So let them not come near the Inviolable Place of Worship after this their year.”
to be a specific prohibition against them entering as they did before Islam in the Days of Jahiliyya, in which they entered the complex with their idols, manifested their polytheistic worship, and engaged in reprehensible actions such as performing tawaf while naked. This is what is prohibited not a blanket ban. [Sarakhsi, Sharh al-Siyar al-Kabir, 1.134-135; Ibn al-Humam/Marghinani, Fath al-Qadir `ala al-Hidaya, 10.63] As for the idolaters being unclean (najas), that refers to spiritual uncleanness due to their beliefs rather than physical uncleanness.
So from this it is safe to say that at the time of Guru Nanak Dev Ji Mecca was not a closed site to non-muslims, so the notion that Guru Ji was on a Hajj cannot be true.
The journey to Mecca must be seen in its context; Guru Ji had previously travelled east to the great pilgrimage sites of the Hindus - Hardward, Benaras, Varanasi, and other places of Hindu importance. Guru Ji then travelled into the Himalayas and even as far as Tibet and Nepal to sites of Buddhist importance, always blessing all who flocked to Guru Ji’s feet and showing them the True path. Are we now to also assume that Guru Ji was a Hindu or a Buddhist because he visited these places ?
The truth is that Guru Nanak Dev Ji’s mission, as propagated by God, was to travel the four corners of the land and promote the True path. It is to Guru Ji’s credit and true conviction that he travelled to places that were often hostile and dangerous, populated by ignorant zealots. But with Guru Ji’s unique way of teaching even the hearts made of stone were melted.
Guru Ji clearly states :
ਹਜ ਕਾਬੈ ਜਾਉ ਨ ਤੀਰਥ ਪੂਜਾ ॥ ਏਕੋ ਸੇਵ ਅਰੁ ਨ ਦੂਜਾ ॥ ੨ ॥
ਪੂਜਾ ਕਰਉ ਨ ਨਿਵਾਜ ਗੁਜਾਰਉ ॥ ਏਕ ਨਿਰੰਕਾਰ ਲੇ ਰਿਦੈ ਨਮਸਕਾਰਉ ॥ ੩ ॥
"I do not make pilgrimages to Mecca, nor do I worship at Hindu sacred shrines. I serve the One Lord, and not any other. ||2|| I do not perform Hindu worship services, nor do I offer the Muslim prayers. I have taken the One Formless Lord into my heart; I humbly worship Him there. ||3||” (Ang 1136)
After this how can anyone be in doubt that the reason to travel to Mecca was not for hajj but to put those people who put so much faith in blind ritual on the true path of God. Guru Sahib Ji travelled to the west from the Punjab making his way towards the muslim places of learning and putting people on the path of God. The city of Mecca was not developed during the time of the Guru. It was a vast desert land and people could commute freely unlike now.
Guru Nanak Sahib Ji is neither the first nor the last non-Muslim to visit or infiltrate Mecca.
One famous incident of a non-Muslim visiting Mecca was the visit by the British explorer Sir Richard Burton in 1853. Burton disguised himself as an Afghani Muslim to visit and write Personal Narrative of a Pilgrimage to Al Madinah and Mecca. Therefore, how can it be impossible for Guru Nanak Sahib Ji, who is ‘Akaal Roop’, the embodiment of the Divine Light of God, to visit Mecca? The whole land belongs to God, so how can the Living Image of God, Guru Nanak Sahib Ji be stopped travelling anywhere in the world. God or God’s power cannot be limited.
As Guru Ji approached Mecca the sun was setting and Guru Ji decided to rest a while. Guru Sahib Ji slept deliberately with his feet towards the Kaaba, this was not an insult to Islam as some would think but a way to gently provoke peoples beliefs. Would a muslim ever deliberately point his feet to the kaaba?
When challenged by the local Imam called Jiwan, Guru Ji replied “point my feet where God is not.” Incensed the man roughly pushed Guru Ji’s feet the opposite way, the Imam found to his surprise that Guru Ji’s feet were still pointing towards the Kaaba. He did it again and again but each time the feet were still pointing to the Kaaba, thus showing that God resided everywhere and that is was our minds that saw him in one place or in one set of people, hardly the actions of a Muslim.
This incident is doubted by some, “How can this happen? How can Mecca rotate like this?”
One must first understand the stature of Guru Nanak Dev Ji. Guru Ji was the embodiment of the divine light, spinning Mecca was a simple way to show the people that God resides in all places
Bhai Gurdas Ji, eminent Sikh scholar whose compositions’ have a very special place in Sikhism writes about this incident in Vaar number one.
In these verses Bhai Gurdas Ji describes the visit of Baba Nanak to the city of Mecca. “Donning blue clothes, holding a stick in one hand and a lota (jug) Baba reaches Mecca and points his feet towards the Mehrab at night. Mullah named Jiwan hits him with his leg saying that who is this Kafir keeping his feet towards the house of God and holding Nanak's legs pulls them to change their direction and sees the "Mecca moving in the same direction". They asked Baba Nanak to open and search in his pothi and tell them as to who is better, Hindu or Muslim. Baba replied to the Hajj Pilgrims that without good deeds both would come to grief. Both Hindus and Muslims would not be accepted in the court of the Lord. In their verbal duals they denounce Raam and Rahim, the world is following the ways of evil. Baba won over everyone. Wherever you go in the world you would not find a place where Baba was not known. From East to the West, all nine divisions of the earth bowed to him (Nanak).
Again a muslim would never condemn Islam, Guru Ji here brings both faiths of Hinduism and Islam on par, unless the Hindu and the Mussalman realise God then both will not be accepted in the court of the Lord.
On Guru Ji’s travels through Bhagdad his companion Mardana would play the rabab and Guru Sahib Ji would sing about the infiniteness of God and His Creation, wherein occurred the following expression:
“ there are numerous patals (earths) and innumerable akashs (sky).”
This is in total contradiction to what Islam believes which only has knowledge of seven earths and seven skies. So Guru Ji could not have been a muslim because again Guru Ji’s view is totally contradictory to Islam, Guru Ji states that there are numerous, countless earths and countless sky.
When a Muslim who was listening realised what was being sung he reported the blasphemy to the Sajjdanashin of the Shrine of Pir Dastagir, Abdul Qadir Jilani. Meanwhile an agitated crowd gathered on the spot. The people were on the verge of throwing stones when they heard the Guru’s divine invocation. The people in remorse went to their Pir and told him of the presence of a holy man. The Pir, having reached the place, enquired from Mardana who the holy man was. He was told that he was Nanak who had rejected all others except one God who was all pervading on earth, sky and in all four directions.
Guru Nanak Dev Ji had many discourses with the holy men and they were convinced that Guru Ji was truly and man of God. Before his departure Guru Ji was presented with a chola (robe) as a token of respect and the high regard the holy men held Him, on which verses in Arabic were inscribed. This chola lies preserved in the Gurdwara at Dera Baba Nanak, in Pakistan. The chola was given to Guru Sahib Ji by his devotees in Bagdhad and Guru Sahib Ji took it in the spirit in which it was given, no more. Pir Babhol, a Sufi saint was also deeply influenced by Guru Nanak Dev Ji.