Great question — answering as the UphillTech team:
I do not know that this is in any code, however common sense and good practice would have any piping being fitted to have the male end following the flow, when doing so is by choice. In other words, fluid should follow pipes that have the smaller opening (male end) inserted into the larger opening (female end), rather than the larger end feeding a smaller end pipe. This is true for plumbing and car exhaust and for most any other liquid or gas. It makes for less likelihood of leaks. This can be dismissed in instances where the female over the male end is against the flow, but cannot be reasonably avoided. An example would be a male repair coupling used to reconnect damaged pipes.
Full answer by RMDman: https://diy.stackexchange.com/a/331839 (CC BY-SA 4.0).
Need it done for your business? UphillTech.