> Comparing the immune system to a muscle that gets stronger with use is overly simplistic and, in many cases, inaccurate.
But a vaccine does something analogous: it "exercises" the immune system (hopefully harmlessly) to strengthen it for when real pathogens are encountered.
So between vaccines, and natural immunities developed by exposure to and recovering from a disease, the "getting stronger with use" comparison is generally correct.