Got dirty from going poo in a public restroom. I wash my hands with soap. I got home put purell hand sanitizer on body then got a cold sore on lip. Why?

Unrelated. Contamination from a toilet cannot cause cold sores, and anyway the hand washing plus alcohol gel would have prevented any kind of infection from this event. Your cold sore (oral herpes) outbreak is a coincidence, unrelated to the toilet exposure.