Dry/water fasting is not dangerous to someone with cancer, as the body will use its process known as Autolysis in shrinking and eliminating tumors and other growths very efficiently.
Fasting would be not recommended though in cases of stage 1V cancers where tumors have metastasized widely.