Viruses like HIV and herpes are fragile, meaning they don't survive very well outside of a nice, warm human body. By the time you sit down on a public toilet seat — even if it was recently shared by someone else — most harmful pathogens likely wouldn't be able to infect you.
Plus, your skin is an effective block against any microbes. (Unless, of course, you have a cut or open wound there, which could allow the bacteria to get in.)