Recent COVID-19 vaccine trials did not include a large number of cancer patients. However, these vaccines do not contain live virus and non-live vaccines are generally considered safe - and are commonly recommended - for cancer patients.
Vaccine effectiveness may be reduced in cancer patients with suppressed immune systems as the ability to mount a response to the vaccine may be limited. Still, the benefit of vaccination is considered greater than the risk of not getting the vaccine, barring any contraindications.
After receiving the vaccine, it is advisable for cancer patients, like everyone, to continue masking, cleaning hands and social distancing.