Obviously, a robotic landing on Mars would help scientists prepare for an eventual manned mission. A robot could find a suitable landing spot for humans, and it could locate sources of water. The technical aspects of a robot mission could also help solve logistical problems of sending people to Mars.
Yes, I believe that a moon landing would aid an eventual mission to Mars. There are a lot of benefits to a moon landing, including practicing and testing landing vehicles or exploration vehicles, or setting up a moon base that would allow for easier launches to more distant celestial bodies.
Moon landings will not help a Mars landing what so ever.
Mars is an orbital planet in the solar system and the moon is an moon around Earth. The two planets have very different surfaces and atmospheres. Technology designed for the moon may be irrelevant to a landing on Mars. One example is the equatorial surface gravity. According to so far human knowledge, Mars has the equatorial surface gravity of 3.711 m/s^2. The moon's is 1.622 m/s^2. This makes all robotic technology a waste of time and money. Although, this depends on the country that sends another moon landing. If the US sends another moon mission, then it simply proves that they have reached a limit in their technology.