I think they were probably allowed to take pets to Hogsmeade.
After Ron loses Scabbers, the twins tell him he can buy a new rat in Hogsmeade:
“Oh, come on, Ron, get yourself down to Hogsmeade and buy a new rat, what’s the point of moaning?”
— Prisoner of Azkaban, chapter 13 (Gryffindor Versus Ravenclaw)
The implication is that there’s a pet shop in Hogsmeade (I think it’s unlikely a shop that only sold rats would do be sustainable). This shop probably provides veterinary assistance to anybody who brings their animals in – both the students of Hogwarts and the residents of Hogsmeade. We see no evidence that this service is provided in-school, and any villagers with pets would need it too.
Often a vet needs to see the animal in question, so students would probably be allowed to take pets into Hogsmeade, if only for this reason.