Interesting thread! US Midwest here.
I would say we generally keep our home bathroom doors fully open or partially (but obviously) open when not in use. If the door is closed, we would assume someone is in there. (At my parents' house, there's a window in the bathroom that my mom leaves open in good weather, and sometimes the breeze blows the bathroom door shut. As it's the only bathroom, I sometimes do a quick headcount to see if anyone is likely to be in there.) Not all home bathroom doors have locks, and even the ones that do, not everyone uses them or they really don't work that well; so if I had need to check on a bathroom, I would knock first, and maybe even call out, before trying to open the door. I definitely don't want to walk in on anyone!
As to smells permeating the house, I've never really noticed this, but I might just be used to it. A lot (but not all) home bathrooms have exhaust fans and/or windows, which might help with that (if people use them). The exhaust fan usually comes on automatically with the light, or is a second switch right next to the light switch. With company around I always use the fan when I'm in the bathroom, not so much for the smell as to add extra noise so they can't hear what I'm doing (or so I like to think).
I would say that generally in a home, if a door is shut it means guests shouldn't go in that room. For example people might shut the door to a bedroom they don't want people in (either because it's private, or just a mess!). Exceptions (doors which are usually always shut, but might be okay for guests to open) include closet doors and those to other storage areas (if you need to get something out, like your coat) and doors to the outside/non-climate-controlled areas like the garage.
Slightly farther afield, I would say that generally guests are expected to stay on the main floor of the house with the "public" rooms (kitchen, dining room, formal living room), and not go either upstairs or downstairs (basement underground) where the "private" rooms are (family bedrooms, informal living room), unless directed by the host. For example, when I go to family gatherings, I keep an eye on the powder room on the first floor (usually the only bathroom on that floor) and use that when needed; I know there are one or more additional bathrooms upstairs with the bedrooms, but my sense is I ought not to go up there unless there's a problem.
Personally I don't like the public restrooms that are just one big bathroom with a single toilet; I'd rather have stalls where I/other people can look for feet or easily ask if someone's in there. I've had a few embarrassing experiences where the lock on the door hasn't worked properly (there's always a lock, but maybe not a functioning one) and I've noticed that people tend to just try the door rather than knocking first. It's weird, because at home they'd probably see a closed bathroom door as occupied; but in a public restroom, sometimes those doors close automatically or the staff periodically close them to avoid the unsightly bathroom view, so you can't assume a closed door means someone is in there. I'm also always worried that I'll call out, "Just a minute!" when someone knocks/tries the door, but they won't be able to hear me (the fans in public restrooms are often industrial-strength rattlers).
Office doors are variable, IME. My friend who has her own office always keeps her door shut and locked, with a sign saying to knock (at which point she has to get up and let the person in). On the other hand my boss (who is slightly claustrophobic) almost always has her door open unless she's having a private meeting, at which point we shouldn't disturb her unless it's an emergency; her door also has a window in it, so we can easily see if she's there or if the door is shut because she's gone home. If I came upon a closed door with no instruction that I thought was someone's office, I would knock first. If I got no response I would probably try the door, thinking I might not have heard them. I think I would be kind of embarrassed if I were "caught" trying a door without knocking first, it would be like I was trying to sneak in--to me, knocking shows that I'm trying to announce my presence and find out if it's okay to proceed.
The homes I go to are usually places where I'm expected, like for a family gathering, so the door is unlocked and people are expected to walk right in. Occasionally I've been startled by a locked door on these occasions, and it usually turns out to be some weird exception, like there's a child who's tall enough to open the door but shouldn't be going out, so the parents just locked the door to keep them in. Otherwise I think these days, most people I know keep the outside doors to their homes locked, so unexpected visitors have to somehow get the homeowner's attention (ringing bell, knocking, etc.) before they can be let in. Some people only keep the door locked if they're gone or asleep, leaving it unlocked when they're home and awake.
Personally I always keep the door to my apartment locked unless I'm actually walking through it, but I'm kind of paranoid that way. In the college dorms I'm familiar with, the culture is to prop your room door open (when present and awake), and people pop in and out of friends' rooms, hang out in the hallway, etc.. My apartment building is on a college campus and primarily consists of students, and sometimes it takes them a few weeks to realize that the building does not operate the same way--we would prefer people keep their doors shut to contain noise, and NOT congregate in the hallway (also noisy).
Apparently I have a lot of thoughts about doors.