I came across this really sad story recently.
It is about a rescue Siberian Husky, Chinook, who is going to be put down because he attacked some children.
As with most of these sad situations, the people most to blame are not the victims, or the dog, but rather the dog owners.
Why do dogs attack?
There could be a variety of reasons, but most dog attacks can be avoided with proper management and supervision. Dogs do much for us; the least we can do is to always keep them safe and happy.

1. Keep your dog secure and safe.
Only leave your dog in the backyard if it is very secure, or if you are around to supervise. If you need to leave your dog alone for a short period of time (< 3 hours), then crate him or keep him in a secure and safe room. Remember to leave him with many interesting chew toys and food toys to keep him occupied.
If you need to be away for long periods of time, then put him in a dog daycare or hire a pet sitter/dog walker.
In Chinook’s case, he has escaped many times from the backyard. To keep him from further escapes, a shock collar/electronic collar was used.
Obviously the collar was ineffective, and may have even exacerbated the situation, because the dog had to endure a large dose of pain as he was escaping. Do no use electronic collars. There are other safer, more effective methods, for training a dog.

2. Keep your dog well exercised.
Most dogs, especially energetic breeds (like Siberians) need interesting mental and physical stimulation for a large part of the day. Otherwise, they will get bored and escape, or use your house and belongings as chew toys.
It is important to walk your dog everyday, so that he gets to explore and smell the great outdoors. If your dog goes out regularly with you, he will be less interested in escaping to find adventure on his own.
Mental exercise is also important. Make your dog work for all of his food in interactive toys rather than just serving him his meals in a silver dog bowl.
I also play tug, and flirt pole with my Siberian; and do fun obedience exercises with her every day.

Even the most friendly, socialized, dog may sometimes “attack”. Maybe someone accidentally stepped on his tail, maybe he just wanted to play and accidentally knocks over the child, maybe …
there could be lots of maybes.
That is why a dog, no matter the size, should always be supervised when interacting with young children. A dog should only be allowed off-leash in off-leash parks and only if you have good voice control over him.
Dogs naturally interact a lot with their mouths. What we do with our hands, a dog does with his mouth.
In addition, a dog is not born with a full understanding of all the rules and laws of our very human society. It is up to us to teach those rules to our dog.
Teach your dog bite inhibition, and teach him that it is unacceptable to bite on humans.
Why do dogs attack?
Frequently because of human error and negligence.
The dog is a gentleman; I hope to go to his heaven, not man’s. ~~[Mark Twain, letter to W.D. Howells, 2 April 1899]