Is it OK that I shouted at my neighbours dog?

My neighbours dogs are the worst. They bark at anything and everything. I sneezed once in our bathroom and they started barking at that. We can't do anything in our garden without them barking. I've literally stood there watching them barking and barking at nothing.

They bark all through the night as well.

Anyway, it's 23:45 and their dog has been barking non stop for half an hour. I got so annoyed I went outside and shouted at him. I went back inside and within two seconds he was barking again so I went back outside and shouted at him. The neighbours then put their outside light on, I guess maybe my shouting at their dog woke them up or something?

Either way, the dog has stopped barking now. But now I feel bad for shouting at him. But I mean a person can only take so much, especially when you often have to hear their dogs barking for in excess of 10+ minutes multiple times a day.

These neighbours are not very nice and friendly, I don't even have their number. They're the kind of people who let off fireworks (while their have their own dogs) during illegal times (in my country there are only certain days and certain hours where you can let them off), they fight outside where everyone can hear, etc.