Because while every animal (and many other things) are potentially dangerous, most will only become actually dangerous if the child does not behave properly. Fix that and you stop a good many problems from ever presenting themselves.
Between the dog and the child, the latter is easier to teach simple rules for the complex situations like these, and it's easier to test whether they understand without actually putting them in the scenario.
Between them again, it's usually the latter's behaviour that (often inadvertently) excites/upsets the dog, which is why they need to learn what they should and should never do. This is how such children grow up to be responsible adults who are not terrified of (or traumatised by) animals.
It's a bit like the rules of aviation, but with mental agility instead of aerobatic agility, in that the one with greater agility is more responsible for resolving a potential conflict. You cannot train a dog to human standards of behaviour or reason... but you can train a human like that. Dogs can be very well trained and, as with the weird aviation analogy, there is still a good amount of responsibility on the less agile to not cause or exacerbate problems too, which falls to the owner in lieu of the dog being able to converse in English.