I've actually never been in a private home that didn't have locks on the doors, but I have accidently walked in on someone who didn't lock the door in a private home.
In my house, I like to keep the bathroom doors closed at all times. When it's just my family at home, it's pretty obvious to us when someone is using the bathroom. During parties, which we have somewhat often, I don't sweat the open bathroom door. But, I also don't assume that just because the door is closed (in anyone's home), it's occupied. That's not always the case. If I'm unsure, I gently knock.
In public, though, like I said, I always try the handle.