Dust will be an issue for solar panels on Mars. Well, it already is. Some sort of mechanical system to clear the dust will be necessary. Nuclear will undoubtedly find a place in the Martian energy scheme. Batteries are heavy too. Hydrogen and/or methane as an energy store might work if sufficient water deposits can be found.
Dust is a problem for solar, the panels seem mostly self cleaning, as is shown by the various Mars rovers. Dust is also a problem for cooling systems for nuclear, through less. There have been various solutions proposed to clean the solar panels, so although a problem it is not an unsolved one, using compressed CO2 to blow the dust off is probably the best. Dust storms are a significant problem for solar, needing either very large storage or drastic demand reduction.
Solar + batteries probably mass more than a nuclear system, but the difference is small enough that details matter - lots of small bases (which favour solar) or one big city (which favours nuclear). Much of the power will be used to create hydrogen/methane (probably mostly methane on Mars), to fuel the spaceships and feedstock for chemical industry, if those hydrogen/methane production plants can be run efficiently just during the day then solar does not need so much storage. Methane may act as backup energy storage for the solar power, it is needed for a few months for the length of dust storms, it is more difficult for backup to nuclear, sending a new nuclear power system and commissioning it could easily take three years.
There is plenty of water on Mars and it is widely spread in ice and hydrated minerals. There is water on the moon, billions of tonnes, but it is widely spread in shaded crators at the lunar poles, it is probably harder to extract than on Mars.
Bringing this back to Tesla, there is a struggle between distributed and centralised energy generation, storage and use. Big nuclear (and legacy coal, oil) is on the centralised side; utility scale solar and wind farms and megapack batteries are somewhere in the middle (but more to the centralised side), and rooftop solar, powerwall and EVs are at the distributed end. Tesla seems to be banking on distributed beating out centralised.
Elon has made many statements supporting nuclear power, but he seems to have decided that nuclear is not one of the technologies Tesla should persue and also that it won't be needed by SpaceX for a considerable time (if ever).