Cocci is bacteria not a infectious disease or virus such as Marecks disease in chickens, parvo in dogs, or flu/cold in humans.
Becoming immune to a certain virus by pre exposure to it is true, but cocci is not a virus.
Cocci usually shows up in the very young or animals that have compromised immune systems.
Immunity comes from the animal getting older and their own immune system functioning at optimal levels, not from pre exposure.
A 2nd time cocci outbreak in a puppy reoccurring (getting it again) is very common if it is re-exposed to the bacteria prior to the puppies immune system functioning at optimal levels (usually under 4mo.)