Assalamu'aalykum. I performed ablution and prayed the Thuhr and ‘Asr together because I wanted to travel to another city. Afterwards, I found some dirt that could block water from reaching the skin on my foot. I do not know when the dirt got there because I did not look at it before the ablution nor during it. I have not made up for these prayers yet because I was busy, and I do not know whether it happened before the ablution. Please clarify what I should do.Also, I read somewhere that if someone forgot to perform Ghusl (ritual bath) and prayed and then remembers, he does not have to make up for the prayer because he believed that he was pure during the prayer. Is this true?
All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu ‘alayhi wa sallam, is His slave and Messenger.
Assuming that the mentioned dirt forms a barrier blocking water from reaching the skin but you doubted as to whether it was there before ablution or not, it does not affect the validity of the prayer because you should assume that it got there after the ablution, and thus the ablution and the prayer were valid. In principle, a new occurrence is assumed to have taken place in the most recent time, i.e. the time closest to the present. As-Suyooti wrote, "In principle, an incident is to be attributed to the most recent time, i.e. to the time closest to the present." [Al-Ashbaah wa An-Nathaa'ir]
As for what you read, it is incorrect if it means that whoever forgets to perform the Ghusl of Janaabah (major ritual impurity) or ablution, for instance, and then performs the prayer and then remembers afterwards, his prayer is valid! On the contrary, his prayer is definitely invalid, and there is no difference of opinion among the scholars in this regard.
Shaykhul-Islam Ibn Taymiyyah wrote:
"The same applies to the case in which a person forgets to purify himself from minor or major impurity and performs the prayer forgetfully, he is obliged to repeat this prayer with proper purification, and there is no difference of opinion among the scholars in this regard. Even if he was an imaam who leads the people in prayer, he has to repeat the prayer. As for the people whom he led in prayer, they are not required to repeat the prayer if they did not know (that he was leading the prayer while being ritually impure) according to the view of the majority of the scholars, such as Maalik, Ash-Shaafi‘i, and Ahmad in his famous opinion in this regard..." [Majmoo‘ Al-Fataawa]
Allah knows best.
You can search for fatwa through many choices