Many are located in less desirable areas, although OK if you take normal precautions. Camping is an alternative worth considering. It is definitely cheap and there are many formal camp grounds. The quality vary greatly. There are also unofficial camp grounds, often ignored by the local police.
Camp sites offer little security.
Typically, it is unwise to sleep in city parks, unless they are officially designated for such. Official government tourist offices are a good, reliable source of information, schedules, etc. Use them for specific information. Especially in high season, don't ask them to help plan your local itinerary. They are paid to assist you in enjoying your stay.