Good morning,
In people there is something called misophonia, this is where a person feels intense anger at certain sounds such as someone else eating an apple. Generally the medical profession hasn't taken it seriously, but there has been some research and one paper was quite interesting.
This paper proposed that sound is processed through two "paths" in the brain. One path handles unexpected sounds and the other path provides a filter to the response generated by the first path.
So a car back-firing or the first firework may cause a person to "jump", but the subsequent occurrences of the sounds are expected so the "jump" response is supressed.
For everybody the first occurrence kicks in an old "fight or flight" type response which quickly dissipates, for people with misophonia the second path never supresses the sound so each occurrence of the sound ups the "fight or flight" level.
Although this theory is not universally accepted it is also not dismissed, so it doesn't seem unreasonable to suppose that such dual pathways may exist in some animals as well. At some small brain size the Expected Sound pathway doesn't exist at all and in bigger brains it works or doesn't work in the same was as it does or does not work in humans.
This idea seems to have credibility when applied to dogs as dogs are usually calmed or agitated by the reactions of the humans around them, but completely relaxed humans do not calm many dogs when fireworks, loud unexpected sounds, are going off. If your dog doesn't like fireworks then there is nothing that you can do because it is a "hardware fault".
Bye
Ian