> Unlike many infectious diseases, recovery from naturally acquired tetanus _does not usually result in immunity to tetanus_. This is due to the extreme potency of the tetanospasmin toxin. Tetanospasmin will likely be lethal before it will provoke an immune response.
Quoted from https://en.wikipedia.org/wiki/Tetanus. Emphasis is mine.
The flu vaccine works the same way: scientists predict which strains are the most likely to spread and create or find weaker strains that are all combined into a single vaccine.
https://www.theatlantic.com/health/archive/2020/05/coronavir...
COVID vaccine work is still in its infancy so we don't know yet whether the non-functional mutations we're seeing in COVID's phylogeny will effect how effective vaccines are.
What could alter the course though is if some treatment is found which makes it essentially harmless, even if immunity would be impossible.