From experience, I was getting oder from my black tank flush valve. It has the cheap plastic valve that many come with. I removed it and took it apart. Some debris had gotten into the valve and kept a little ball from seating properly. I replaced it and made sure the input line had a screen filter washer. Since then all good from it.
Part Two: I’ve notice an oder in the bath. The ceiling vent is less than two feet from a tank chimney and when the wind blows in the right direction, or events draw air into the vent from outside, the place stinks. So we keep the vent closed unless the exhaust fan is in use.