Your right about genes being turned on and off and enviromental factors play a big role in this.
This topic could get very involved and complex, but to put it simply, lots of genes get told to turn off when on AAS e.g the genes that initiate test production, the genes that initiate spermatogenesis. Some also get turned on, such as those that cause extra receptors to be made, and tell satellite cells to turn into muscle cells.
It is highly doubtful that there is a direct link between anabolics and cancer but indirectly...., well, lets not kid ourselves, I'm sure we're eleveating the risk, but possibly only by a fraction i.e. no where near what smoking does, or years of working in an asbestos factory.
Asbestos and cigarrette smoke are known carcinogens, and even then not everyone gets cancer from them, so given that AAS have never really been linked the risk is minimal and the other healthy life style habits such as working out, diet, supplementary anti-oxidents etc., should go some way to counter acting this (in fact the amount of anti-oxidents I take, I actually think I'm at quite a low risk). Hope this helps all concerned!!