Both flies and mung bean flies are carriers of bacteria and viruses that harbor and infect them, so they may carry large amounts of bacteria and other microorganisms on their bodies. Specifically, however, green head flies may be dirtier than mung bean flies because they often feed on feces, garbage, carrion, and other filth, and because their digestive systems and mouthparts are less than sanitary, making them susceptible to spreading disease and bacteria.
Overall, both flies and mung bean flies have living conditions and behaviors that cause them to be dirty insects. However, which one is dirtier needs to be determined on a case-by-case basis.