In reality, masks only protect against a very small number of all of the pathogens that a human consumes. That small number includes a lot of the bad ones though. Wearing masks will certainly help prevent person-to-person spread, but I highly doubt it would have any meaningful impact on the evolution of the immune system.
Edit: More food for thought: Humans aren't the only ones evolving. The more we get exposed to diseases, the more those diseases evolve to infect us more efficiently. Note that efficiency doesn't equal lethality, but still.