They aren't. Recessive genes have an effect on the effect of the gene, it is just not as pronounced. Someone with a recessive gene that allows immunity to a disease and a dominant gene that does not allow immunity will have a reduced immunity to the disease rather than a complete absence.