If the dog isn't mean you can see if it has tags and call the local animal shelter for owner info. This does work this is how I returned a 14yr dog that had never left it's owner before except on this night.
Another one is to take the dog in your yard and or house and post it on craigslist and pet FBI. This worked also when I was returning a chocolate lab, it took three days but the owner was happy to have his dog back and grateful for not having to pay shelter fees. This dog had a running problem and the owner was in the process of moving to a new place with a fenced yard.
Another time I found a dog that someone had ask me previously to take and I said no, I already have 3 dogs. 2 weeks later I found this dog on the corner of main st and picked it up and went to it's owner and they said they had given to the people behind them and that they had a hole in their fence. Also the dog had been out for about 8 hrs and no one looked for it at all, he was close enough to his home to be found. I didn't take this dog home to it's owner. I became it's new owner. They didn't need or deserve him.
So it really just depends on what your willing to go through to help a dog/animal. Of course avoid dangerous dogs, but some of them / a lot of them aren't mean there scared instead.