This is probably even more complex than "The dose makes the poison". UV has some benefits and other known drawbacks (e.g. skin damage and cancer).
It doesn't work on non-chemicals: UV, radiation, noise, heat/cold, pressure, physical trauma, repetitive motion, exertion, posture, etc.
Perhaps a more intuitive way of stating it is, "Some classically bad things can be good in small or optimized doses. Some classically good things can be bad when taken to excess."
Running is good for you, running 20km every day for years will prematurely destroy most people's knees.
I guess applying the adage in that way makes it become a tautology though, too much is in fact, too much.