I've tried responding to this thread a few times... but I really don't know how I'd handle such a situation. I can't even imagine my dogs being away from me and lost and finding a different family. It upsets me just to think about it, nevermind if it happened.
I'd look for them for a long time. I still miss one of my dogs that died immensely and wish she was still here, and it's been many years now since she's been gone. Nevermind knowing that a dog I loved might still be alive and well, just lost... I don't know that I could stop looking. And if I found the dog, I'd probably bring proof with me that it was mine and hope they'd give me the dog back. I'd even offer to buy the dog back. Not sure if I would take legal action or not.
And if I adopted a dog, there's a good chance I would give the dog back to it's original family if they found out I had it. It would depend on a few things (how sincere they are, what kind of owners, if they'd actually been seriously looking or just stumbled upon the dog again somehow, etc.), but if it were my dog, I'd want it back, and I hope that I could offer the same courtesy to someone else and give a dog back.
A dog getting lost or stranded is a lot different than a dog that was surrendered or a stray. A lost dog is usually a very, very well loved pet. And it could happen to anybody. For me, I just don't know if it would be right to keep the dog forever. Even if the owners found it years later. I don't know.
Maybe it would depend on how long I had the dog vs. how long they've had it by that point. If I had it for a shorter time than they did, maybe it's more fair to let them keep the dog? Like I said, I don't know, and I hope it's something I (or any of us) never have to go through. It's heartbreaking to even think about.