just fyi, when people say "unclean" or something like "ritually unclean", they're referring to the typical washing before prayer (ablution, wudu). If you get licked or pet a dog, your wudu is void and you have to perform it again if you want to pray. some other things that void wudu are:
going to the bathroom
vomitting
being unconscious
so to make as close of an everyday analogy as possible, petting and getting licked by a dog is about equivalent to taking a piss. just wash up before you pray and everything is fine. You don't have to be "ritually clean" all throughout the day--only if you need to perform acts that its mandatory for, the most common of which is prayer. the only reason I could see a typical everyday muslim avoiding a dog for is to keep ablution. I'd avoid petting my friend's dog when I stayed over at his house to keep my ablution between my noon and afternoon prayers for instance, its just out of laziness as washing up takes like 20 seconds.
Black dogs (and cats I believe too) are a different story, as many believe completely black animals to be evil, though I'm not really sure if this is cultural or religious. My dad doesn't like black animals for instance, lol, but from my private school teachings it seems to be ambiguous.