Comments from my sister, who lives in a rural and poor part of Poland:
According to her, this basically boils down, in Polish culture, to dogs being both obedient and low maintenance. You don't really have to take care of a dog that well. You throw it a few scraps here and there, you kick it when you're annoyed with it, and it will stay loyal. For free.
By contrast, if you mistreat a cow, you will have a tangible, monetary loss. A cow or a pig is an investment. Horse? Forget even THINKING about treating it badly, horses were historically expensive. And Poland having had centuries of cavalry-related traditions and culture, horses have been glorified, treated as almost human and their intelligence and nobility overestimated. Also, horses are fragile animals and it's VERY easy to make one sick or injured.
Basically the answer boils down to: dogs are cheap, loyal and often take abuse with little protest. Many people are just dicks and want to mistreat anyone and anything they can, but they can get away with that with dogs. So dogs have a reputation of being "low" animals.
Granted, that's likely not the entire story, but I find it a compelling argument. Dogs are not objectively filthy or "unclean", but they are perceived as such, and the fact they don't need much taking care of leads to their perception as somehow "off".
(same reason pigs are stereotyped as dirty because they are often kept in conditions where they can't POSSIBLY stay clean. Despite the fact that pigs are highly intelligent and, given the opportunity, tend to avoid unhealthy substances and getting dirty more than some other farm animals. Basically, people take conditions they keep an animal in as proof of the animal's inherent character, in a weird and twisted bit of quasi-logic)
EDIT: dogs being very flexible in their diet is also probably a factor. Dogs eat all sorts of things we consider trash, including spoiled/rotten food, and that doesn't easily kill them. Ironically, their lax dietary requirements make them MORE similar to humans and MORE suited to coexisting with us, but the fact that a dog will eat most anything contributes to them being perceived as... less than dignified animals.