I always get my youngest to ask if she can stroke any dogs, even if they come up to her she must ask the owner first. Although this still isn't always safe, a few weeks back we were in the park and a lady with a shitzu(sp) came along. Georgia asked if she could stroke him, the lady said 'yes, hes very friendly' I was watching them as I always do, she was just stroking his head and all of a sudden he turned on her and jumped up, growling and trying to bite her hands. Poor Georgia cried(she's only 4) and the stupid woman said he was just playing!!! He was not! She was really shaken up and it took her a while to calm down.
Georgia now wont go near little dogs, she's really scared off them.
My other daughter doesn't really talk so wont ask to stroke them, so she just stays away.
I think letting your child approach unattended(I know you were a few meters away) dogs is very dangerous! It's a good job you have two lovely dogs xx