working out at the gym will put more stress on your immune system than help it. you are exposed to a lot of things there, make sure you wash your hands before/after working out. also the air quality in gyms is awful, which is why i tell guys not to do cardio in the gym. bad idea
the best ways to boost immune system is fasting, a diet rich in fruits/veggies, and getting good quality sleep. those are 3 things everyone on here can improve if they weren't stubborn