As a communist country, many laws in Vietnam are seen by western countries as overly strict or just plane weird.
Here is a brief overview of some of the laws and penalties that differ from western countries.
DRUGS - Transporting illegal drugs in or out of Vietnam carries a maximum penalty of death.
Don't be deceived.... in spite of the significant number of foreigners you will see smoking cannabis in the streets, it is NOT legal to do so. Many incorrectly believe it is. The penalty if arrested by police can result in a very long time in jail.
PROSTITUTION and PORNOGRAPHY - Highly illegal.
PUBLIC DECENCY LAWS - There are no nude beaches. Topless women can and have been arrested, but not often. Even western women wearing sexy or revealing clothes in the conservative city of Hanoi will be called a slut and/or a prostitute and treated with contempt.
SPEAKING AGAINST THE GOVERNMENT - No freedom of speech in Vietnam. If you voice your opinion of the Vietnam War, Uncle Ho, corrupt police or government officials or the evils of communism, you risk arrest, time in jail and deportation.
CO-HABITATING WITH THE VIETNAMESE - The attitude to the law is relaxing over recent years, but the laws are still on the books. It is illegal for a foreigner to share a room with a Vietnamese of the opposite sex without a certificate of engagement or marriage.
ONLY VIETNAMESE CAN HAVE A VN DRIVERS LICENSE - By law, only Vietnamese people can obtain a VN drivers license. Some foreigners through a little bribery or kind favours have been able to get one. Your foreign drivers license has no validity in Vietnam. This includes the "International Drivers License". Vietnam does not recognise them at all.
PAYING THE POLICE - If you want a police report for your travel insurance to make a claim for that stolen camera or missing cell phone, expect to pay a service fee for them to do so. This is not a form of bribery or corruption, but it is their legitimate service fee and will issue a receipt.
CRIMINAL DECEPTION, NOT A POLICE MATTER. - If you get ripped off by a taxi driver, overcharged or tricked into paying higher fees at your hotel, the Police are not interested. Those are regarded as civil matters of dispute and not a crime.
From the Australian Government website regarding Vietnam....
Penalties for serious crime, such as rape, espionage and hijacking, include the death sentence.
Penalties for drug offences are severe. Under the Vietnamese penal code, a person caught in possession of even a small amount of heroin can be sentenced to death. There are over 20 Australians currently serving life sentences or facing the death penalty for drug trafficking convictions. Vietnamese authorities have announced increased security and investigative measures to combat drug trafficking.
Photography of, or near, military installations is generally prohibited. You should also avoid taking photographs during demonstrations.
It is against the law for you to export antiques from Vietnam without a permit. The Ministry of Culture can provide further advice and any permit that may be necessary for export.
Non-marital sexual relationships and cohabitation between Vietnamese citizens and foreigners is illegal in Vietnam. Permission for foreigners to marry a Vietnamese citizen must also be granted by Vietnamese authorities. Any children born in Vietnam to unmarried parents cannot have the father's name on the birth certificate.
Gambling, except in government licensed casinos, is illegal in Vietnam. Anyone found to be in violation of this law is subject to steep fines and/or a severe prison sentence. Access to licensed casinos is restricted to holders of foreign passports.
Local laws prohibit possession of pornographic or political material. Being caught in possession of these will attract penalties, including fines and detention.
Foreign citizens involved in non-state sanctioned political or religious activities may be subject to detention and /or deportation.
There has been an increase in incidents where local authorities have prevented the departure from Vietnam of any foreigner involved in a commercial dispute by withholding their passport until the dispute is resolved.