It is not uncommon for a dog to exhibit fear of loud noises such as thunder storms or fireworks. It is important not to inadvertently reinforce your dog’s fear by showering him with attention and attempting to soothe him with petting when he shows fear.
Instead, give your dog a job.
One method is to condition him to respond in a different manner to noise. Example, if he starts to pace, work on simple skills such as sit or down reinforcing your dog for holding a position. Another option is to pair high value treats or toys with the sounds he finds unpleasant. I.E. does your dog love to play ball? Have a ball handy and when he starts to react to sound, tell him to get a ball and play. Other examples may include continually rewarding him with treats or taking out his favorite toy and tug.
This technique will condition him to look forward to the noise and anticipate the reward that will associate the sound.
Make the noise association something fun and your dog will soon begin to enjoy loud noises!