Abu Hurairah reported the Messenger of Allah ﷺ as saying: when any of you prays and takes off his sandals, he should not harm anyone by them. He should place them between his feet or pray with them on
Hadith Referenceسنن ابي داود / كتاب الصلاة / 655
Hadith Gradingالألبانی:صحيح | زبیر علی زئی:إسناده صحيح
It is permissible to perform prayer both by removing the shoes or by wearing them. However, occasionally performing prayer while wearing shoes, with the intention of reviving the Sunnah and expressing opposition to the Jews, is a cause of reward and virtue. Nevertheless, care should be taken that this action does not become a cause of discord among the uninformed masses. It is forbidden (haram) to cause harm to any Muslim in any way.
Explanation & Benefits
Shaykh Umar Farooq Saeedi
655. Commentary: ➊ It is permissible to pray both after removing the shoes or while wearing them. However, occasionally praying with shoes on, with the intention of reviving the Sunnah and expressing opposition to the Jews, is a cause of reward and virtue. Nevertheless, care should be taken that this action does not become a cause of discord among the uninformed masses. ➋ It is forbidden (haram) to cause harm to any Muslim in any way.
Source: Sunan Abu Dawood – Commentary by Shaykh Umar Farooq Saeedi, Page: 655