https://www.nasa.gov/mission_pages/sunearth/spaceweather/ind...
I expect that designs for 'permanently underground/inside' cities would need to include some high-ceiling park-like areas with some bright UV lights, and other considerations, but that sort of thing seems pretty doable. Whether it would be enough to maintain a population's mental heath I guess would need to be seen, but generally speaking I think humans are a pretty adaptable bunch...
Definitely doable. But then there's no longer any special appeal to living on Mars, as opposed to: living in rotating space habitats among the asteroids.
If we reformulate Musk's goal as being: "Create off-site backups of human civilization", then I think asteroid mining & space habitats have a better shot at bootstrapping this process than colonizing Mars.
Once we are leveled up this way in resources and technology, building settlements on Mars can be a side-effect of this outcome. Just like the burgeoning scientific outposts on Antarctica are a side-effect of our current civilization.
But rotating space habitats might not be as good at replacing gravity as some think. Even with the really-huge 'O'Niell cylinder' scale (8 kilometers diameter), coriolis effects would be noticeable. I suspect a number of industrial processes would be affected by it.
I expect some of the major industrial processes will still need/want to be done on a big pile of rock or sand, rather than in a more fragile object that inherently wants to explode and fling apart all the time :).