The prevalence of cancer is rising globally, and it is the second leading cause of death. Nutrition has an important influence on the risk of developing cancer. Moreover, changes in the gut microbiota are connected to the risk of developing cancer and are critical for sustaining immunity. Various studies have shown that intermittent fasting, ketogenic diet, and the Mediterranean diet are effective therapies in changing the intestinal microbiota, the prevention of cancer, and the improvement of tolerance to treatment in cancer patients. Although there is not enough evidence to show that the ketogenic diet is effective in changing the intestinal microbiota in a manner that could prevent cancer, intermittent fasting and the Mediterranean diet could positively affect composition of intestinal microbiota against cancer. In addition, the ketogenic diet, intermittent fasting, and the Mediterranean diet have the potential to stimulate anticarcinogenic pathways, and they might increase cancer patients’ quality of life according to scientific evidence. In this review, we represent and argue recent scientific data on relationship between intermittent fasting, the ketogenic diet, and the Mediterranean diet, intestinal microbiota, cancer prevention and cancer treatment.