Viruses like SARS-CoV-2 use sugar molecules to hide from the immune system, but scientists at Scripps Research have designed a universal coronavirus vaccine that strips these sugars and exposes a stable, rarely mutating part of the spike protein. This approach triggered strong immune responses in
Vaccines at a simple level just train your immune system to attack certain proteins. If you could identify a protein that differentiates cancer cells from healthy cells then you could make a vaccine for cancer.
I do not have a degree in biology, take this info with a grain of salt. If a credentialed individual has better info, please speak up.