Fundamentally, ownership or legal possession is a societal construct. I only own my house/car/computer/patent/whatever because I, everyone else, and especially the government believe that I do. If someone steals your stuff, you expect your tax dollars to help you get it back/prevent further theft. There is no magical galactic law of property which defines ownership, it's just something we agree on.
Now, what happens when someone disagrees on ownership? In places with law, you'd go to court where the different claimants argue their cases and the government (or someone else legally binding) adjudicates. When a decision is made, for example person A owns the property XYZ, then the government promises to protect person A's property from people who would steal it (with police, military, etc).
In places without law, eg the archetypal Wild West, you can impose your own version of law through the application of force: for example, the cowboy's revolver. The cowboy gets the other people to agree that his herd of cattle is his, not because of some law, but because he will shoot anyone who says otherwise. A gang of bandits, who disagree, can claim ownership of the cattle by shooting the cowboy.
Currently, there is no enforcement of space law. No country has space marines, space police, or star fighters to back or defend claims. Yes, there are some (rather flimsy) agreements between Earth-nations not to do anything untoward in space (eg. the OST) but this primitive space-law has only been upheld because no country has had any reason to break it. If suddenly proverbial oil were found on the Moon and it were profitable to get it, the OST goes right out the window without a second glance.
Thus, to answer your question:
If you land on Mars or the Moon or wherever, establish a claim, and shoot anyone with your six-shooter if they disagree with your claim, it is effectively yours until someone with a bigger gun comes and takes it from you.