Regarding the question, we would like to quote Dr. Muzzamil Siddiqi, former president of the Islamic Society of North America (ISNA), who stated:

It is permissible to pray with the shoes on, if they are clean. There are many Prophetic Hadiths on this subject. Sa`id Ibn Yazid Al-Azdi (may Allah be pleased with him) said: I asked Anas Ibn Malik (may Allah be pleased with him) whether the Prophet (peace and blessings be upon him) had ever prayed with his shoes on. He replied “Yes.”

Having stated the above, I add that it is better to take shoes off when praying inside a Mosque because Mosques have to be kept very clean as many people come to pray and sit there. However, praying outside the Mosque one has a choice either to keep one’s shoes on if they are clean or to take them off. However, if there is doubt over the cleanliness of one’s shoes, then one must take them off for prayer.