Yes, it is permissible to wipe over the second pair of socks if he put them on over socks that he had wiped over, because he put them on when he was in a state of purity. So that comes under the general meaning of the words of the Prophet (blessings and peace of Allah be upon him) in the hadeeth narrated by ‘Urwah ibn al-Mugheerah from his father who said: I was travelling with the Prophet (blessings and peace of Allah be upon him) and I reached out to take his khufoof (off his feet) and he said: “Let them be, for I put my feet in them when they (my feet) were pure (after doing wudoo’).” And he wiped over them”
Narrated by al-Bukhaari, 199
An-Nawawi (may Allah have mercy on him) said: If he put on the khufoof (leather slippers) when he was in a state of purity, then he broke his wudoo’ and wiped over them, then he put on the jarmooq (a kind of large khuff that is worn over the regular khuff) when he was in a state of purity in which he had wiped over the khuff when he did wudoo’, then there are two well-known opinions as to whether it is permissible to wipe over them (the jarmooq). The first opinion is that it is permissible to wipe over them because he put them on when he was in a state of purity. And the second opinion is that it is not permissible, because that was an incomplete purification. That is how many of the scholars look at it.
Ar-Rawiyaati said: The more correct view is that it is not permissible to wipe over them. Others said that the more correct opinion is that it is permissible to wipe over them. This is the opinion of Shaykh Abu Haamid. It may be understood from the words of ar-Raafi‘i and others that this (the second view) is more correct and it is the view that is to be favoured, because he put them on in a state of purity. Their saying that it is an incomplete purification is not acceptable.
End quote from Sharh al-Muhadhdhab, 1/534
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: If he put on khufoof then broke his wudoo’, then he wiped over them, then put another pair of khufoof over the first pair when at the time of putting on the second pair, he is in a state of purity for which he wiped over the first khufoof, then the view [i.e., the view of Imam Ahmad] is that the ruling on wiping applies to the first pair, because he put on the second pair after breaking his wudoo’.
Some of the scholars said: If he put on the second pair when he was in a state of purity, it is permissible for him to wipe over them, because it is true to say of him that he put his feet into them when they were in a state of purity. The Prophet (blessings and peace of Allah be upon him) said: “for I put my feet in them when they (my feet) were pure.” This includes purity attained by both washing and wiping. This is a strong view, as you can see, and it is supported by the fact that our companions (may Allah have mercy on them) stated that wiping over the khufoof removes impurity. So he put on the second pair when in a state of complete purity, so why shouldn’t he wipe over them? But if he put the second pair on when he did not have wudoo’, then he cannot wipe over them because when he put them on he was not in a state of purity.
End quote from ash-Sharh al-Mumti‘, 1/258
And Allah knows best.
Reproduced from Islam QA