It's not a myth.
In Sweden allemansrätten (lit. "the everyman's right") is a freedom granted by the Constitution of Sweden. Since 1994 the Instrument of Government says that notwithstanding the right to own property "everyone shall have access to nature in accordance with allemansrätten"
source: Wiki
You are allowed to use nature but you are also responsible for it. There are some restrictions which are summarized by the Swedish Environmental Protection Agency. For camping you have to check the local rules, in some areas it's not allowed to camp (check e.g. national parks). In general you have to look for developed ground. I once heard unless the local householders can't see and hear you, it's OK to construct your tent there if you keep everything clean of course. There are no strict rules though. And you shouldn't stay more than one night at a place.
As a dog owner you have to observe strict rules in order to protect wildlife.
Check also naturetravels.wordpress.com where they e.g. say
The Right of Public Access has a number of parts, but in essence it can be summed up in the phrase “Do not disturb, do not destroy”
and for the differences between other European countries, see https://outdoors.stackexchange.com/a/111/2653
To summarize, just take care for others - not only human beings - and everything is predestined to have a great time in the Swedish nature :)
To answer regarding the comment from @Paul
We can't give exact rules of behaviour because there are no strict rules in the law. I find this very admirable because the government seems to trust people to act properly.
I think the camping aspect is very interesting, I will therefore quote the complete part from naturetravels.wordpress.com:
I’ve heard that you can camp wild anywhere in Sweden. Is this true?
Up to a point, yes. The freedom to camp wild is one of the great joys of an outdoor holiday in Sweden. You should not pitch your tent on farmland or near a house, and stays in any one location are limited to a night or two.
Groups of friends pitching two or three tents do not need to obtain permission from the landowner, but as always, you must respect the privacy of anyone living nearby and take care not to damage the natural environment.
Generally, a good rule of thumb is to ensure that you pitch your tent out of site of people’s houses and do not stay more than two nights in the same spot. Don’t forget to take all your litter away with you (including food scraps –orange peel, for example, can take many years to degrade naturally!). If no other option exists, make sure you bury your toilet waste properly. Choose a spot at least 50m from houses, camping spots, water sources, etc. Dig a hole 15cm deep for your waste and then fill in soil on top. Do not bury non-degradable items such as children’s nappies or female sanitary products.