Could be. I think it is difficult to say for certain. That is what I do though In the winter time I use a sun vitamin D lamp myself.
I know that there are other substances created by different fractions of light outside of UVB. As examples, UVA apparently helps to make nitric oxide in the body. NO helps with circulation along with a host of other health benefits. The infrared spectrum of light helps create another substance that is believed to help with circulation. So in my opinion it doesn't hurt to have some exposure to the full spectrum if available.
Another idea about how sunlight helps prevent cancer that I like is how sunlight can be used to treat jaundice in infants. In the past babies born prematurely that had high levels of bilirubin that causes jaundice would be placed outdoors exposed to sunlight. The sunlight would break down the billrubin, treating the jaundice. I think in hospitals today intense blue light therapy is used to treat jaundice in infants.
I don't know if other toxic substances in the body can be broken down by sunlight. It would not surprise me though if sunlight can help eliminate other unwanted items from the body. Just a guess though. I haven't read into that.