Not all dogs panic when they hear loud noises and there does not seem to be any particular breed predilection for this behavior. Two separate and distinct areas of the brain are responsible for sensing then responding to loud noises. Cells that sense loud noises respond by increasing their electrical activity sending strong signals to cells in the response area of the brain. Those cells respond by conveying the information; LOUD, SCARY, DO SOMETHING! When your pet detects a loud noise, remember their hearing is significantly more acute than that of humans she/he/it cannot tune out the sound like hearing a ceiling fan, the TV or other common background noises.
The response cells process the received increase in electrical activity and send out signals that require the dog to do something. What the dog does in response to the loud noise input varies with the animal and can range from shear panic and panic behavior to a yawn and going back to sleep. What is confusing is that many dogs seem to develop the panic response in mid-life, perhaps having experienced something painful or uncomfortable associated with a loud noise. Most puppies and young dogs do not exhibit much of a response to loud noises, but there are always exceptions.
The pressing question, if you have a dog that panics at loud sounds, is what can I do about it?
When you go away put your dog inside in a safe place you have created for him/her. Many dogs will choose a room or area where they are most comfortable and where they go when unsupervised. Make certain they have free access to this area when you are gone. Encourage them to use a room with few outside windows and use blackout curtains on any windows in the room. This will dampen the noise level. Turn on an appliance that creates background noise, an air purifier, a fan, a TV, a radio tuned to classical or soothing music. This is not the time for hard rock.
Make certain the dog has a comfortable bed, hardwood floors and hard walls transmit loud sounds. I hesitate to tell you this, but it is a sign of the times. You can purchase “Dog Appeasing Pheromone (DAP)”. I saw it in a pet store as a plug-in that claims to be a species-specific calming scent. Can you see my eyes rolling back into my head?
If you are with your dog during Fourth of July firecracker season or a thunderstorm, try to establish a connection between them hearing a loud sound and something nice. Try to calm him with praise, feed him a special treat. Scared dogs will not eat and a dog eating something especially desired will not be scared.
If none of this works, ask your veterinarian to recommend a professional trainer or animal behaviorist who specializes in behavior modification. As a very last resort, your vet can prescribe a tranquilizer, but these work best if given before the loud stimulus so in anticipation of fireworks. Your vet may or may not approve of this use of drugs. I am hesitant in all but very severe cases where the dog is liable to hurt itself or others.