Well, I'm Canadian, so we don't celebrate the fourth of July here, but we do have Canada Day on the first! We've always lived outside of the city since we got our dog, but we very recently moved back into the city less than a month ago. There is always some sort of Canada Day firework event going on, and we've been fortunate up to this point because we couldn't see or hear them from where we lived. Haru, my dog, is very jitterish and gets frightened easily by loud noises (even small things like a plate dropping make him scurry away). I'm a little bit worried about how he'll react come the first of next month - which I just realized is tomorrow, my goodness - to be honest. I don't expect he'll get scared to a point that we'd need to do any sort of sedation (I've seen this method recommended for dogs that are especially anxious of fireworks) but I expect I'll have to sit with him inside and hold onto him to be sure he doesn't freak out. The basement in our house is very quiet so I'm hoping that if worse comes to worse just taking him down there might be enough to calm his nerves.
As for the running away - unless you already KNOW that your pet will do fine with the fireworks based on past experiences, I don't think it is ever a good idea to bring a pet along to watch fireworks with you. Animals need a safe, familiar place to retreat to, and if you go out somewhere unusual to the animal they are obviously more likely to run away. If you do take them out though, I'd say to always make sure the pet has an ID tag on no matter what.