No, STIs are not transmitted this way. They are sexually transmitted diseases or infections, and require some kind of sexual activity to transmit - oral, vaginal or anal sex, or direct, unclothed skin-to-skin contact of mouth to genital, genital to genital, or genital to anal, with some friction.
The only thing you'll get from using public toilets is a little grossed out.