Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
To pray wearing shoes is permitted. The Prophet (Sallallahu Alaihi wa Sallam) used to pray sometimes without shoes and sometimes having shoes on.
In Saheeh Bukhari and Muslim and others, from Abu Salama Said bin Yazid said: "I enquired whether the Prophet (Sallallahu Alaihi wa Sallam) used to pray wearing shoes, the reply was “Yes”.
Ahmad, Abu Dawud and Ibn Majah reported from Amr bin Shuaib, from his father narrating from his grandfather who said, "I saw the Prophet (Sallallahu Alaihi wa Sallam) praying without having shoes on and praying having shoes on."
Sometimes praying wearing shoes is something desirable in order to demonstrate that this is permissible, and in order to be different from the Jews. Abu Dawud reported in the Sunan that Shadad bin Aws narrated that the Prophet (Sallallahu Alaihi wa Sallam) said: "Act in a different way from the Jews, they do not pray having shoes on or having socks on."
Of course this has to be done after checking the shoes; if there is any dirt in them, one must clean it rubbing them on the ground, then he can pray wearing them, as the Prophet (Sallallahu Alaihi wa Sallam) said: "If one of you comes to the mosque, he has to check his shoes, if he sees any dirt in them, he has to clean it rubbing them on the ground and pray with them." [Reported by Abu Dawud]
Abu Taymiyah (may Allah have Mercy on him) said commenting on this Hadith: 'This is an evidence that they used to pray with their shoes on, and in the mosque, if there were no rugs or carpets' [taken from the Great Fatawa].
Therefore, if a person wants to pray with his shoes on he can do so on the ground or gravel, but one should not pray wearing shoes on carpets or rugs, like in our mosques today.
Allah knows best.