Assalamualaikum wbt. I have a question. What is the ruling of praying while wearing wet and muddied clothes due to flood? The reason is I’m involved in flood volunteer and sometimes we didn’t have enough time to change our clothes due to time constraints and other matters. Hope for an explanation.
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions, and all those who follow his footsteps until the Final day.
We start with the statement of Allah SWT:
“And your clothing purify,” 
AL-Syaukani said the above verse means Allah SWT commanded him to purify his clothing and protect it from najis. While Qatadah said it means to purify yourselves from sins. 
Al-Sa’di in his commentary stated that the possibility that the word ‘clothing’ in this verse means all the actions of Rasullullah PBUH and the meaning ‘purify’ means with sincerity and with the best implementation from any matters that invalidate, damage and decrease the rewards such as shirk, riyak, nifak, ujub, takbur, distracted and others commanded to His slaves to be avoided when worshipping Him. It includes the commandment to clean one’s clothing from najis. The reason is the matter is one of the parts of the perfection of purification especially in prayer, as stated by scholars which state removing najis is included in the valid conditions of prayer.
Furthermore, there is a possibility that the word ‘clothing’ means exactly that, clothing that we know. In other words, Rasullullah PBUH was instructed to clean his clothing from any najis all the time especially during prayer. If the Prophet PBUH was commanded to purify what is evident, then indeed the purification of the visible is a part of the purification of the soul. 
Valid conditions of prayer
Among the valid conditions of prayer is one must be free from any najis on his body, clothing and prayer place. It is understood that najis should be cleaned from one’s clothing through the instruction of Rasullullah PBUH to Khaulah bin Yasar. Khaulah asked the Prophet PBUH:
يَا رَسُولَ اللهِ إِنَّهُ لَيْسَ لِي إِلاَّ ثَوْبٌ وَاحِدٌ وَأَنَا أَحِيضُ فِيهِ فَكَيْفَ أَصْنَعُ ؟ قَالَ : إِذَا طَهُرْتِ فَاغْسِلِيهِ، ثُمَّ صَلِّي فِيهِ
“Messenger of Allah, I have only one clothes and I menstruate in it, how should I do? He said: When you are purified, wash it and pray in it. She asked: If the blood is not removed, (then what)? He said: It is enough for you to wash the blood its mark will not do any harm to you.” 
The above hadith shows that the Prophet PBUH asked for the clothing worn for prayer to be cleansed first from any najis.
Praying while wearing muddied and wet clothing due to flood
First, we should know the original ruling for soil is pure. The reason is Allah SWT created every surface on this earth as the place of prostration (for prayer) and the soil is pure for tayammum when water is not available for the ummah of the Prophet PBUH. Rasullullah PBUH said:
وَجُعِلَتْ لِي الأَرْضُ مَسْجِدًا وَطَهُورًاً فَإيما رجل مِنْ أُمَّتِي أَدْرَكَتْهُ الصَّلَاةَ فَلْيُصَلِّ
“The earth has been made for me (and my followers) a place for praying and something with which to perform Tayammum (to purify oneself for prayer). Therefore, anyone (of my followers) can pray (anywhere) and at any time that the Salat (prayer) is due.” 
The same applies to flood water. The original ruling for it is pure and purifying for it is included as mutlak water. Mutlak water is pure and purifying water which is a type of water that retains the original characteristics of its creation by Allah SWT. The water is still considered as mutlak water even when it has changed because it is left for a long time, due to soil, moss and left stagnant or it is where limestone flows.  Especially, flood water of which it is usually an overflow of water from rivers, sea, rain or others which is categorized as water that can be used to purify oneself as stated by Dr Wahbah al-Zuhaili. 
Moreover, this matter also follows the Islamic legal maxim:
الْأَصْلَ فِي الْأَشْيَاءِ الطَّهَارَةُ حَتَّى تَتَحَقَّقَ النَّجَاسَةُ
“The origin of something is it is pure and clean until najis is evident.” 
Furthermore, al-Sa’di also stated the maxim:
والأَصْلُ في مِيَاهِنَا الطهارةُ # والأرضُ والثيابُ والحجارةُ
“The origin of water is pure, The same for soil, clothing and rock.”
Syeikh Hamad Abdullah commented on this maxim saying that the meaning of this maxim is that the origin of water, soil, clothing and rock is pure and clean. The evidence on the purity of water is as stated by the Prophet PBUH:
إنَّ الماءَ طهورٌ لا ينجِّسُهُ شيءٌ
“Water is pure and nothing can make it impure”
Hence, the original ruling for seawater, river, spring and others is pure and clean. Thus, when you get wet from an unknown channel of water, is the water pure and clean or najis? We state: “Indeed, the original ruling for water is pure and clean and due to this we don’t obligate you to clean your clothing from it.” 
It can be understood that following the above maxim, any clothing, soil, water and others remain pure and clean as long as there is no evidence of najis.
According to the above discussion, in our opinion, a person who prays while wearing muddied and wet clothing from flood, his prayer is valid on the condition that there is not any clear sign there is najis on it for the original ruling of something is pure and clean until najis is evident.
However, if there is time, a person should change into clean and proper clothing for it provides comfort and helps for him to focus. This is since prayer is performed to get closer to Allah with khusyuk and humility in showcasing our submission to Him.
May Allah SWT grant us a clear understanding in religion. Ameen.
 See Zubdah al-Tafasir min Fath al-Qadir, by Sulaiman al-Asyqar, pg. 776
 See Tafsir al-Sa‘di, 1/895
 Narrated by Abu Daud (365)
 Narrated by al-Bukhari (438)
 See al-Fiqh al-Manhaji, 1/31
 See al-Fiqh al-Syafi‘i al-Muyassar, 1/79
 See Tarh al-Tathrib fi Syarh al-Taqrib, 2/114
 See Syarh Manzumah al-Qawaid al-Fiqhiyyah li al-Sa‘di, 3/3