All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
It is not from the Sunnah to wash the legs before or after entering the toilet or restroom. The basic principle is that any place which the feet walk over is ritually pure unless it is known with certainty to be impure. You must repel Waswaas and totally ignore it.
Also, you are not required to wash off the impurity before performing ablution or Ghusl (ritual bath); it is sufficient to remove the impurity during the ablution or Ghusl.
Again, you must disregard such satanic whisperings and pay absolutely no attention to them. Getting carried away with them leads to grave evils, as they are the work of Satan. For more benefit, please refer to fatwa 209290.
Allaah knows best.