The mask is intended to reduce the release of COVID19 virus from the infected individual to the susceptible uninfected contact. The mask reduces the expression of a significant amount of virus from the mouth and nose of the infected person The effectiveness in preventing the transmission from a person wearing a mask is limited but not insignificant.
But a mask is not particularly effective in protecting a susceptible, non-infected person from inhaling a sufficient dose of CORONA19 virus to protect against infection. Thus just wearing a mask is no assurance of personal protection.
In other words, you are a pilot standing at the door to the cockpit welcoming pax aboard. All of the passengers are wearing masks. Any infected passengers will be emitting virus but at a significantly reduced level. Your risk of being infected is consequently reduced regardless if you are or are not masked yourself.
If none of the infected passengers is wearing a mask, the “dose” of CORONA19 virus will be elevated as will be your risk of infection.
The real world test of this phenomenon has been in countries where masks have been widely used. There the incidence and prevalence and mortality has been reduced. Currently both the CDC in the US and the WHO recommend wearing masks in public. And the major air carriers in the US are ‘mandating’ them.