If we can make RNA vaccines against COVID-19 and we know which errors in our DNA leads to different kinds of cancer, can we make a vaccine that will teach our immune system to detect and destroy cancer cells?
It is not only possible, these vaccines are in active development. Biontech (the company which developed the Comirnaty Corona vaccine) was founded to develop vaccines against cancer, Moderna is developing similar approaches. It was the research on the cancer vaccines and the development of the mRNA vaccine approach in general made the fast vaccine development for the SARS-CoV-2 vaccine possible.
Biontech has published results of a mRNA based cancer vaccine against melanomna in the summer of 2020 (reference 1) which shows promising results, Moderna has shown data from a phase I study on head and neck squamous cell carcinoma (reference 2). See references 3 and 4 for an overview over the topic.
Might not be the answer you're looking for, but there's already a vaccine for one particular type of cancer - cervical cancer. Cervical cancer is largely caused by a virus though (HPV, Human papillomavirus). See Wiki.
Three HPV vaccines (Gardasil, Gardasil 9, and Cervarix) reduce the risk of cancerous or precancerous changes of the cervix and perineum by about 93% and 62%, respectively. The vaccines are between 92% and 100% effective against HPV 16 and 18 up to at least 8 years.