The E-D would probably have very relaxed rules, as she also tolerates kids running around her corridors. Vessels operating in the TNG era but built decades earlier might have limitations due to the lack of facilities or safeguards, though. But I'd assume both your starbase and Voyager
would have facilities capable of handling a dog or a dozen.
Would TOS era regulations be stricter, just because TOS imitates the uptight 1960s rather than the easygoing 1980s? Hard to tell. The ship rather easily absorbed a flock of kids in "And the Children Shall Lead", at any rate.
In "Man Trap", we were introduced to some plants that, while supposedly sessile, seemed to lead rather active lives... They'd probably count as pets of sorts. We didn't see pets in crew quarters or workspaces until "Trouble with Tribbles" - but remarkably, when those little balls of fur did come aboard, there was absolutely no mention of a regulation that would have limited their presence or freedom of movement. So I'd say most pets in TOS would be okay, too. And the ENT era is of course well covered by the Beagle Clause.