Is it permissible to pray wearing shoes when necessary, or not?
Praise be to Allaah.
Yes, that is permissible, because the Prophet (peace and blessings of Allaah be upon him) prayed wearing his shoes. In al-Saheeh it is narrated that Abu Sa’eed said: The Messenger of Allaah (peace and blessings of Allaah be upon him) lead us in prayer whilst he was wearing his shoes, then he took them off [whilst still praying], and the people took their shoes off too. When the Messenger of Allaah (peace and blessings of Allaah be upon him) said the Tasleem [at the end of the prayer], they said: “O Messenger of Allaah, you took off your shoes, so we took off our shoes too.” He said: “Jibreel came to me and told me that there was some dirt on them, so I took them off. When any one of you comes to the mosque, let him look at his shoes, and if he sees any dirt on them, let him wipe them. And they can be purified with dust.”
(Narrated by Abu Dawood, no. 650). The point here is that praying in shoes is permissible. It says in the hadeeth: “Be different from the Jews, pray wearing your slippers or shoes.” (Narrated by Abu Dawood, no. 652). But the condition is that the shoes must be taahir (pure, clean). If there is any najaasah (impurity) or dirt on the shoes, then one should not pray wearing them or enter the mosque in shoes, unless he is sure that they are free of impurity or dirt. And Allaah knows best.