You raise an important issue, and the OP asks a good question. Sunglasses, because they reduce the amount of light entering your eye, result in a dilated pupil as compared to no sunglasses. Thus, dark sunglasses that don't effectively block UV light may actually lead to *increased* eye damage as compared to not wearing them. Same thing with ski goggles- if they darken the scene, your pupils dilate and more UV will enter your eye.
The same principle holds with laser safety- you are safer doing beam alignment, etc. with the room lights on.