Yes, certain medications can affect the immune system. Examples include immunosuppressants used in the treatment of autoimmune diseases and some cancer medications. It is important to consult with a healthcare professional regarding any concerns about medication and its impact on the immune system.