united-states
if I bought land for a SOLE purpose and the local govt. does not agree
with my legal use of it, is that justifiable for me to ask for my
money back, or sue them because I lose money on the land
Usually not.
The government has a duty to compensate you for depriving you of uses of your property through regulation (which is called a "regulatory taking") only if it is a "total taking" which is to say that it deprives the owner of all economic use of their property that is more than de minimis.
So, for example, if your land is downzoned from allowing skyscrapers to allowing the construction of single family homes only, you have not experienced a compensable regulatory taking.
On the other hand, if the government declared that your land can't be used for any purpose other than as open space, you would have experienced a regulatory taking and would be entitled to the loss in market value which you experienced.
A more comprehensive analysis of the regulatory takings doctrine under U.S. Constitutional law, with a few nuances from this basis analysis can be found at FindLaw.
The right to compensation for a total regulatory taking arises from the 5th Amendment to the United States Constitution which is incorporated via the due process clause of the 14th Amendment to also be applicable to state and local governments.
Most states have parallel protections in their state constitutions and state statutes as well. A few of those state law protections are more generous with regard to compensation for regulatory takings than the U.S. Constitutional minimum standard set forth above.
I buy land in 'X' city and want to use it to build my own house (no
permits), or run a hot dog stand
I very much doubt that there is a single city in the United States where you can legally build a house without permits or run a hot dog stand without a license.