Answer
Wa `alaykum as-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
1- There is no objection on praying the funeral with shoes on, as there is no evidence for taking them off.
2- As for making du`aa’ with the wasilah of the Prophet , if you ask Allah by means of believing in and loving the Messenger of Allah, this is permissible.
Responding to your question, Dr. Muhammad Salama, PhD in Islamic Studies in English and an Associate Professor at the Faculty of Islamic Science, Al-Madinah International University, states:
The authentic Hadiths tell us that the Prophet (peace and blessings be upon him) prayed while wearing his shoes or sandals and that he even recommended his companions to do so in order to show distinction from the Jews.
It is needless to say that the shoes or sandals have to be clean from najasah (ritually impure substances). Also, mosques with carpets should be kept clean from dust as well and thus one should take off his shoes when entering these mosques.
You mentioned that you were in the vicinity of the mosque and hence wearing clean shoes while praying is basically permissible in this case. I do not understand why the imam asked you to take off your shoes. Perhaps he had some point of view and perhaps also he does not know the ruling of the issue.
With regard to making du`aa’ with the wasilah of the Messenger of Allah, this wasilah could mean:
1- To ask Allah by means of believing in and loving the Messenger of Allah (peace be upon him). One may say for example, “O Allah, by means of my faith and belief in your Messenger, forgive me.” This is permissible because having such faith is a good reason to ask Allah by.
2- To ask Allah by means of the supplication of the Messenger of Allah. In other words, one comes to the Messenger of Allah during his lifetime and asks him to pray for him, as many of his companions did.
3- To ask Allah by means of the honor or status (or the like words) of the Messenger of Allah. There is disagreement among scholars whether this is a kind of legitimate and permissible wasilah.
Those who object to it argue that the very honor and status of the Messenger of Allah is not a relevant reason to ask Allah by. They also employ the principle of sadd al-dhara’i` (blocking means to evil) in this context arguing that opening this door may cause people to overestimate the Messenger of Allah and to associate attributes of divinity to him.
Allah Almighty knows best.