Yes, that is a given and not a problem. I certainly don't want to buy stolen property. My worry (and maybe I am too cautious) is what if the now well known icloud problem appears, where it gets locked to an unknown apple-id after a reset or the likes in the future. Will in that case the case be enough for Apple to unlock it or not...
This "locked to an unknown Apple ID" thing is not a "well-known iCloud problem." It's being claimed here, in this thread and others like it, but you won't find it in media coverage (Mac Rumors would certainly have a raft of articles regarding such a bug, if it existed). It's very much like alien invaders as an explanation for unusual lights in the sky - it's a convenient explanation for an unexplained phenomenon that some find to be emotionally satisfying.
Like a typical UFO sighting, one can cite real-world conditions/human behavior that can explain what happened. It doesn't mean that those real-world conditions/human behavior were actually the cause, it's just that, in the absence of physical proof of sentient visitations from another planet, human behavior seems far more likely - there's no shortage of misbehaving humans.
It's easy to imagine that someone in a phone store took a replacement phone out of its box, began to set it up for someone, then put it back on the shelf because something was wrong ("Oh, this should have been a 64GB instead of a 16GB!"). Maybe they got busy or sloppy, and forgot to sign out of Find My iPhone. Another worker grabs the box, hands it to another customer, "Here, you can set this up when you get home," and rushes off to lunch.
It's also easy to imagine that a child let another kid handle the iPhone ("Oooh! Let me see it!"). The "friend" signs in with his/her account (or maybe the account of another "friend"), then accidentally (or maliciously) fails to remove it from Find My iPhone when the first child said, "Put it back the way it was!" The problem doesn't come to light until months later, after the original incident is all but forgotten (and certainly wouldn't be admitted to, if it was remembered).
I could keep spinning scenarios, but I think you catch my drift.
There's no credible reporting of iPhones that simply latch onto an unknown Apple ID that's somehow floating around in the ether. If the masses can't manage to sign into iCloud or iTunes without the right password, how does it happen spontaneously? Why would it happen only for Activation Lock, what about contacts, calendars, email, text messages?
My advice? Don't worry about this spontaneous Apple ID "bug." Worry about a dishonest seller. There are few, if any, effective ways to ensure that a used phone shipped to you in the mail will be what the seller advertised. Maybe it'd be Activation Locked. Maybe the screen will be cracked, or it'll be 16GB instead of 64GB. Maybe the "small scratch" turns out to be a major gouge. Lots of ways you can get something other than advertised, and the chances of getting your money back may be limited or zero. Now, certain marketplaces may certify the sellers, or the seller is a reputable business. But outside of that, the only way I would buy a used iPhone would be if I could hold it in my hands in the presence of the seller, and thoroughly check it out before forking over the dough.