For God's sakes, this is basic biology. The immune system doesn't stop viruses entering your body, it just gives the body an ability to fight viruses when they're in it!
This is Sesame Street level of knowledge! The immune system NEVER blocks infections from entering your body, it CAN'T - a virus is subcellular. But if your body has an antibody stored up from a previous infection or vaccination, that is what we call immunity in this context.
What you're talking about is more things like legal immunity or diplomatic immunity. Similar idea but you're being very foolish indeed by conflating them.