There are many opportunities for infections to pass in the hospital. It doesn’t have to be just by surgery. Infections from surgery can be caused by the patient’s own bacteria, the surgical staff, or the OR and hospital in general.
Without ever going near the surgery suite, there is still plenty of chance to pick up airborne viruses and bacterial infections. Physicals, blood draws, IV lines, etc all provide an opportunity to pass infections from the environment to the patient or person to person.