The effectiveness of vitamin D as a cancer treatment is highly debatable, and anyone claiming otherwise (for or against) is mistaken or selling something. Not all UV radiation has the same effect on your skin. Tanning beds are tuned to make you tan; they are not particularly effective for vitamin D production.
You should avoid tanning. I am sure no one who has had skin cancer would recommend the experience. You're presenting a false dichotomy. Even if vitamin D were effective as a cancer remedy, it does not follow that tanning is a good way to get vitamin D. How much sun or dietary components you need to fulfill your body's needs for vitamin D is also difficult to estimate, and depend significantly on latitude, but there is little evidence to suggest that the amount of sun exposure required would produce or maintain changes of skin tone.
For what it's worth, I'm from Alaska and pretty used to taking vitamin D supplements throughout the winter. That and heavy drinking. I prefer living in the tropics and maintaining a natural tan. My mother was taken in by the vitamin D crowd when my father developed cancer, not to the point of rejecting traditional medicine, however. It is easy to find biased sources of information promoting many natural remedies; it is harder to find good studies. Like they say, "You know what they call alternative medicine that works? Medicine." If you're inclined to dispute any of the above please cite reputable studies. If, for any given remedy, one can't demonstrate a significant effect with a large group of people and a well-controlled study, it's a pretty useless remedy.