I pet someone's dog and I feel the urge to wash my hands afterwards.
That's interesting, was a dog dirty or something?
There's a high chance of getting dog shit on your hands
I get what you're saying. Animals can be filthy at times and it's good to be careful.
Exactly, that's why I want to make sure that I don't have anything nasty on my hands.
Nothing wrong with practicing good hygienic practices. Just don't be extra about it, a lot of dogs are able to groom themselves and be clean.