According to this expert, it does.
“Frequent exposure to various pathogens primes or jazzes up the immune system to be ready to respond to that pathogen,” said Dr. Paul Skolnik, an immunovirologist and chair of internal medicine at the Virginia Tech Carilion School of Medicine. “If you’ve not had those exposures, your immune system may be a little slower to respond or doesn’t respond as fully, leading to greater susceptibility to some respiratory infections and sometimes longer or more protracted symptoms.”