Why does the bathroom always smell bad? Sometimes it's the smell of smoke, sometimes it's the smell, sometimes it's the smell of burning.
The situation you are talking about is probably that your bathroom is very close to the kitchen, and then the smoke exhaust pipe in the kitchen is connected from top to bottom, so the smell of cooking in other kitchens can be strung together. When I was testing the indoor air in a client's house, I could smell the downstairs neighbors roasting salted fish in their kitchen and bathroom.