This may be counter intuitive, but the best thing you can do is ignore the noise.
What usually happens is something like this:
- The dog hears a noise that she doesn't know how to deal with.
- She looks at you for guidance. Is this dangerous?
- You see her looking at you and talk to her to calm her down.
- She doesn't understand a single word of what you say, but she understands that you give her attention exactly when the scary noise is there.
- She learns that the scary noise is something bad. The next time she hears it, she wants to go home.
- Again, you talk to her to calm her down. Again, she doesn't understand a single word, but she understands that you also react to the scary, so it must be very bad.
I know that you talk to her in good intention, but you actually reinforce her fear of the noise. The opposite of well done is well intended...
To break the cycle, stop reacting to the noise. Act as if you didn't hear a thing and continue your walk as if nothing happened. Of course she will try to return home at first. It takes a while to unlearn a habit.
If she is very afraid (tail between her legs), kneel down and let her get comfort from you. Do this not as a reaction to the noise, but as a reaction to her fear. Be passive and don't call her to you or talk to her. Just kneel down and she'll come to you for comfort if she is afraid. You can gently touch her, but don't actively pet her. Continue your walk after giving her some time to calm down.
If that doesn't work, turn the scary noise into a signal for something good. This is especially effective for New Year's Eve and other days with lots of fireworks. You need to have a small container of very special treats at hand at all times. This can be a hotdog sausage or some cheese cut into small pieces. The container should be closed to not distract the dog with the smell all the time, but you need to be able to open it and get a treat out in mere seconds.
Now every time you hear the bang of fireworks, you simply give her a treat. In this method you can even react to the noise, but in a very positive way, like saying in a very happy voice "Was that the signal for a treat? It was! here you go."
All these methods need time to truly work. You probably know how hard it is to break a habit. Now imagine how hard it must be for your dog who cannot know that her bad habit is unreasonable.