Once, I was traveling my regular route and passed a small group of people standing in their yard when, suddenly, their unleashed terrier dashed out behind me and gave chase. Like your encounter, he didn't seem to view me as prey, but more like a playmate. His owners made no attempt to call him back.
I instantly thought of something Stapfam had once posted and began calling out to him, "Come on, Doggie, come on! Good doggie, c'mon, let's run!" The dog chased me about three or four blocks and then, tired and stopped. I smiled all the way home, thinking how his owners would need to trudge all the way down the street to collect him. I haven't seen him out there since.