In dog training, I have made many mistakes and some that haunt me. Hence I'll never make those mistakes again. When my son was first born my dog at the time was a Belgian Malinois named Odin. I had raised him myself from a pup. He was a fantastic dog, tough, fearless and undying desire to work. I loved him immensely. Being a very strong-minded dog and he also had a very high genetic capacity for aggression so in knowing that I socialised him heavily. Odin was a very social dog with all species including others peoples children of all ages. We did numerous public demonstrations. This dog had encountered 1,000s upon 1,000s of people without one issue.
I wanted to have my dog around my son, of course, are you kidding. I found myself pushing Odin out of the way and numerous times because of my son, and I was often quite hard on him. He did initially want to investigate and sniff my son, but I would tell him off harshly and quite often put him outside. So now my son is six months old, and one day I was in the backyard with Odin, and my sons' mother comes to the backdoor asks is it ok to come out with our son? I say yep no problem let me grab Odin. So they came outside and sat down, my son is now on his mother's lap, and I sat opposite them with Odin by my left side. I have my hand completely under his collar. They are only a couple of feet in front of us. Odin begins to make a noise that I have never heard him make before, and he became very stiff and rigid. I remember thinking what the hell is going on here. He then lunges for my son's arm and missing him by millimetres, I pull him back and telling him off, both us agree this is not a good idea at all. She takes our son back into the house. He had every intention of hurting and maybe even killing my son that day. It was then that I truly realised what I had done. The thing was I knew better. Because of my overwhelming desire to protect my son and being such emotionally charged behaviour, it blocked me from making any rational decision. I will always cringe when I think of what I did and what could've happened.
I had created a behaviour in my dog that I had never seen before from him and never saw it again with anything or anyone.
I hate and love that story, and it's not one I'm big on coming forward with but as you can see. It is about the environment and how they are treated within it. There certainly other factors to consider such as genetics, prior learning, i.e. training and socialisation.
It is as simple as this prevention is always better than the cure. So by the dog having the correct temperament, coupled with training and socialisation. But don't expect miracles, start with small sessions and build it up. Rome was not built in a day, and neither does real learning and conditioning. With a real concerted effort, you can teach most dogs to enjoy and value children. I never leave a child alone with a dog as children can barely be responsible with themselves so why would you expect them to be responsible with a dog.