Some rooms would be very convenient if the doors didn't open into the room (guest toilet, bathroom, dining room),
so you don't have to be careful when setting up the room. Oh, and our hallway is pretty big anyway, so the doors there wouldn't be "in the way" if they were open.
We planned this with the door to the living-dining room, and it will go out into the hallway. The hallway has a 10 cm wall to the kitchen right at a 90 degree angle so that the door wouldn't "stand somewhere in the way" even when open.
Of course, you plan the rooms so that the door doesn't get in the way. But I find the door in the hallway even less annoying than in the room. The hallway is almost 3 feet wide. And the guest bathroom door, for example, is actually always closed anyway, so it doesn't open in the hallway.
And the door from the dining room opens at the wall in the hallway. So that wouldn't be a problem either, even if it was open.
When you plan the position of doors in a room, you usually put them in front of the closet in the corner of the room.
And mostly hallways are a little narrower, i.e. as narrow as necessary so that the doors prevent the right way from seeing the escape route.
Of course, there are situations, such as small chambers, where the door can be opened to the outside, such as a toilet or storage room.
You can do it – you can do it with any frame. You don't do it because you minimize the risk of getting hit in the head.
Also, most doors are usually open anyway (especially for kids), and it's not practical in the hallway.