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 is His slave and Messenger.
For the validity of wiping over the socks in ablution, it is a condition that the person put them on after having previously performed ablution (and washed his feet).
Hence, if you principally doubt that you put them on after having performed ablution, then it is not valid to wipe over them because this is doubt in the existence of the condition itself. The rule according to the scholars is that “every condition whose existence we doubt is like a decisively non-existent condition, so we do not issue a ruling based on it.”
Shaykh Ibn 'Uthaymeen was asked, “I put on socks, and then when I wanted to perform ablution, I forgot whether or not I had put them on after having performed ablution; what should I do?” He answered, “You must take them off and wash your feet, because this is a doubt in the existence of the condition, and in principle the condition does not exist, so it is not permissible for you to wipe over the socks while you doubt whether or not you have put them on after having performed ablution… ”
However, if you are certain that you put them on after having washed your feet in ablution and you are still within the period during which it is permissible to wipe over them and then you doubted whether or not you have taken them off, then this is a doubt about the existence of an impediment – which is taking off the socks – and doubting the existence of an impediment is has no effect, as the scholars said, “In principle, there is no impediment, because doubting the impediment has no effect.” In this case, it is permissible for you to wipe over the socks because, in principle, you did not take them off, and the Fiqh rule says, “In principle, a thing remains as it is.”
As regards the cases in which it is possible to apply the rule that says that ‘certainty is not overruled by doubt’, then you should refer to the books of Fiqh rules in this regard.
Allah knows best.