My children are generally very well-behaved, and some people have even suggested that I may be too strict(!), but you can not always predict the behaviour of children. I have repeatedly told my children to NEVER touch or approach strange dogs, and have given them lengthy explanations why, and made sure that they see information about dog attacks in the news.
However, they have never been attacked by dogs, know only friendly dogs, and are animal lovers in that annoying 'I want to cuddle you to death' way that children have. So this tends to be one of the few areas where they have repeatedly ignored my warnings. As soon as a dog and owner walks past they are like bees to honey. Well they were, until one dog owner really shouted at them (oh the mortification of being shouted at by a stranger). They were about 11 and 7 then, and I've never had a problem since.
So, you can't completely control children (more's the pity). But I will keep trying.