Yes in some places animal control can eventually intervene and take your dog away from you for excessive barking because the dog is disturbing the neighborhood peace when it's constantly barking.
A little dog barking is okay and nothing to worry about but when a dog constantly barks again and again it drives the neighbors crazy.
Nobody deserves to have to put up with constant dog barking as it interrupts their sleep at night and they have a right to peace and quiet and relaxation in their home and yard.
For example a neighbors dog kept barking at me when I went out into my yard and I asked the neighbor nicely to control the dog.
They didn't want to control the dog and thought it was a joke.
So I got the town and animal control involved and eventually after a few months they came and took the dog away from them.
Now I have peace and quiet.
I don't hate dogs but dogs need to be quiet at times and not bark at everything they see.