I understand why pigs are “impure” (parasites in the meat), but why dogs?
Dogs can be infested with parasites just as easily as pigs.
Science welcomes change when we find a better way to do something. Is assumed that humans can be wrong and learn. Religion will fiercely oppose change because god can't be wrong by definition (and nobody has the authority to fix it). Ideology will oppose also changes that see as a menace, but can be more flexible.
It is not the same as "being unhygienic", though it overlaps to some degree. (Faeces etc.)
An interesting example from Judaism is "Tzaraath", which means skin disease, but it could also afflict houses. Today we do not know for sure what it even meant. Mold infestation? Maybe.
https://en.wikipedia.org/wiki/Tzaraath#Affliction_of_housing