I agree that the Moon can train people for certain things : low gravity, the need to wear spacesuit outside the craft for long durations, the presence of high radiation, electrostatic dust that can get into the suit's joints,
dangerous but useful superoxides lying on the ground, the training to everytime get in and out of airlocks and keeping a person psychologically and physically healthy in an environment not on safe Earth and possibly attending to medical emergencies. But these elements can be trained on by having a big spacecraft like Starship on the Moon for a week or two. There is no need for a base on the Moon.
Additionally, the environmental conditions on Mars are different than on the Moon and probably this is why Elon is pushing more for a Mars station than for one on the Moon. One close analog for Mars on Earth is Antarctica which has cold and storms ( but snowstorms, not sandstorms ). if you want more extreme cold on Earth the people going to Mars can train for a bit
in Yakutsk in Siberia in Russia where in winter the temperature can be -71 celsius.
Are there other situations or conditions on the Moon that you think can train people for Mars ?