When traveling from country to country, local laws and regulations can vary from what someone is used to in their home country (sometimes drastically, for example caning in Singapore for visiting foreigners overstaying their visa by more than 90 days). When visiting other countries, what is the best way to learn the difference between their legal code and the one you're accustomed to, to avoid any unpleasant surprises?
The ministries of foreign affairs of many countries offer travel advice on their websites.
These sites are well known for their advice on safety and security and entry requirements. Nevertheless, they also have sections on "local laws and customs". Look for instance what the FCO says about Singapore.
If I have the slightest doubt that something I am gonna to do is legal in the country I just ask some local people about it. Depending on the activity I even ask a police man.
Plus I read a bit about any country I am visiting in a guide book. If there are certain laws that are very different from the 'Western World' they are usually mentioned in guide books.
That should cover you for most things you do as a tourist.