I don't have a pet either, but I'd think to wrap a scarf or blanket around the head of your pet to dampen the noise and keep them close to you or in your bed to reduce the harm.
The OOP mentioned there's no opt-out, hence my suggestion of ways to opt-out, but most public firework shows are opt-in and I agree it should be the main way to see fireworks. I bring earplugs to some fireworks shows I see, because I'm trying to protect my hearing even as I am enjoying it. In the spirit of offering solutions to this problem, you can start your own HOA where you either ban pets because they could be harmed by fireworks, or outlaw anything that could ever be an inconvenience to anyone.