Pets don't do well when there are fireworks going off. They often run, terrified by the noise, and just keep running. Soon they are hopelessly lost and can't find their way back home. Or worse yet, become injured; even killed.
So as the Fourth of July festivities begin, keep your pet safe and confined. If your pet still manages to escape your best efforts, don't forget to put up signs in your area when your pet is lost. And don't forget to call your local animal shelter.