There are certain requirements of Statehood according to the Montevideo Convention on Statehood of 1933, which is just a codification of international customary law:
- a permanent population;
- a defined territory;
- government; and
- capacity to enter into relations with the other states.
Is it "legal" to buy a piece of land and claim it to be another country than before(either inventing a new one or migrating it to an already existing one)? According to international law, it is.
Sure. But just because you say something is the case, doesn't mean it is. Always. Sometimes it is. But for present purposes, let's say that if you found an uninhabited island and said that you were a country, that wouldn't be the case - nor if you bought it from a man living on it.
If you found some land that belonged to another country and decided to claim it as that of an existing country, then it would depend on the specific circumstances.
That's exactly what happened to the Krim island in the Ukraine(now Russia maybe?), right?
I don't think so. As far as I know, the annexation of territory isn't considered sale. In any case, the ownership of this land is still under dispute.
So, if it's possible without the influence of these international institutions, trying this in an area with their influence would be easier, right?
- If trying this means declaring some land you have purchased to be a new sovereign state
Nope. You probably still don't meet the requirements for statehood.
- If trying this means the acquisition of some land by an existing sovereign state
Maybe. Probably not. The Montevideo Convention requires that statehood not be gained through force; while member states' interests may be greater where they are more invested, the requirements for acquisition of territory are the same no matter where you are.
What would prevent me from creating my own nation?
Money, defensibility, recognition, the fact that you probably don't own any land that you "buy" (depending on the jurisdiction and real estate system), the fact that you generally can't unilaterally declare yourself a sovereign state.