An old Asia hand I know says this: "Your best insurance policy for any trip in Vietnam is to stay off motorbikes. Don't ride one yourself. Don't ride on the back. And watch out for them on the streets."
He's right, but the sad fact is that motorbikes and motorbike taxis are the best and most common way to get around most Vietnamese towns. In some cases, a ride on a bike is the only choice for covering short city hops or getting to the bus station, for example. The decision is yours, of course, but be careful: Tuck your knees in, wear a helmet, and ask the driver to slow down (say dii cham or give a thumbs-down gesture) if he gets going too fast.
The greatest danger to your safety when traveling Vietnam is, in fact, road travel: Getting around by car or bus means throwing your lot into a system where might is right, and the fastest vehicles or the ones that look and sound most like the apocalypse have the right of way. Even major highways are narrow and require a bit of "chicken" -- or "forced giving way" -- when opposing vehicles meet. An estimated 30 people die every day on roads in Ho Chi Minh alone.
The good news is that anonymous violent crime is almost nonexistent in Vietnam. Petty thievery and pickpocketing is an issue, but you'll have no problems if you practice some vigilance with valuables (keep passport and cash in a concealed travel wallet or in a hotel safe). Also, try to stick more to the well-traveled roads, especially at night -- walking down dark alleys is never safe in any country. In general, foreign visitors have no problems with crime in Vietnam unless they're doing something wrong themselves.
Vietnam is politically very stable, so don't worry about getting caught up in any insurgency, though tensions and mistrust do continue between Vietnam's ethnic hilltribe communities and the central Vietnam administration. Terrorism is nonexistent because the visa restrictions are so tight, and because anyone doing anything funny under the watchful eye of the Party -- and that means you -- just gets the boot. There have been a number of cases of journalists and members of evangelical religious denominations being detained and having materials confiscated. Whatever you're doing in Vietnam, just make it look like tourism and you should be okay.
Corruption in government on all levels is rife, and, if you find yourself talking with the local constabulary, know that you won't be "protected and served" in Vietnam, but "harassed and collected from." Road violations are usually handled with an expected small bribe at curbside, for example, and you can typically bribe your way out of -- or into -- any situation. In general, however, local law agents don't want anything to do with foreigners unless there is a clear road to a quick profit. If in doubt in any circumstance, contact your country's embassy or consulate.
Marijuana may appear legal in Vietnam, considering its widespread availability -- especially in beach towns like Nha Trang -- but don't be fooled. The same guy who sold it to you collects a few dong for informing a crooked cop, who then collects his dong bounty and a few dollars from you -- or, worse, jail time if you can't produce the requisite bribe. Not worth it.
Dealing with Discrimination
Western visitors of all races are treated as a collective oddity in Vietnam; no one gets particular attention, really. In certain rural parts, the arrival of a Westerner draws a crowd. Foreign visitors are greeted everywhere with spastic shouts of "Hello" -- often genuine, but for local kids, especially, it's usually something like shouting "punch buggy" when you see a Volkswagen. Say "Hi" back and you've made someone's day, but responding to everyone -- especially when it's not too genuine -- is a bit much. Vietnamese are motivated by a friendly curiosity with foreigners, and that often translates to pushing boundaries of physical space: tugging at arm hair (not unusual for Vietnamese) or grabbing at your personal items (not to steal, just to see). It's okay to push people away, but know that Vietnamese are motivated by curiosity and operate under different definitions of personal space.
Women alone rarely run into any special problems in Vietnam, but all should take caution when alone at night. If unmarried, or traveling sans spouse, the pity is laid on pretty thick.
Gay travelers should note that there are laws against homosexuality in Vietnam, but the laws are more or less institutionalized prejudice -- and the impetus for harassment and police blackmailing scams. Raids on homosexual establishments are not uncommon. Beware of homosexual touts and escorts, many of whom act in cahoots with police on scams. A large gay culture does exist in the big cities, but it's kept well under the table.