All things considered I would do pretty much what you did, except that my hand would be on my pocketed pistol... just in case. I have no trust in or respect for people who let their dogs roam free in such public areas.
Perhaps their dog is trained.
Perhaps he is very friendly.
Perhaps he will not bite.
None of that obligates me to taking a chance with the safety of myself or family. Many people have learned that lesson the painful way.