I suppose the more common scenario is that diabetes precedes and increases the odds of getting cancer. A diabetic is already running degenerative metabolism (fermentation with production of harmful aldehydes and lactic acid) that any cancer cells that develop will also run, and the high sugar makes it easier (less selective pressure on them) for cancer to develop, and once cancer develops, the high sugar makes it easier for them to reproduce more quickly.
In someone who got cancer without having been a diabetic, the logic of this reversal of things is:
Cancer –> excretion of free fatty acids –> increased insulin resistance –> higher than normal blood sugar –> feed forward stimulation of cancer growth –> feed forward stimulation of excretion of free fatty acids, etc, etc..
Tumors take up copious quantities of glutamine and glucose. They make many different compounds useful to their survival from this glutamine, including glutamate and free fatty acids, which they excrete. Both glutamate and free fatty acids impair immune defenses against the cancer, and free fatty acids increase insulin resistance and thus raise blood sugar, which preferentially feeds tumor growth and reproduction.