Could walkers be used on Mars? These walkers would range from 20 ton 2 legged machines to 110 ton 12 legged machines with the most common ones ones being 60 tonnes with 8 legs. These mechs are low to the ground. Things like artillery are done by very wheeled vehicles. Infantry isn't a concern & are mostly transported by the aforementioned large wheeled vehicles with smaller tracked vehicles to fight in enclosed domes or catacombs. Sometimes they would fight underground in large bored out caverns where infantry & small (~20-40 ton) tracked vehicles would be a concern. The technology level is near future & planetary bombardment isn't a concern.
Assuming you have the AI / human pilots to do the walking, and the money to build them, and the rockets to get there, this is pretty doable.
Joints seizing / wearing out / etc will be the biggest issue you'll face, but there's ways around that using seals, lubrications, and other non-exciting things. They have their own complexities from the temperature, but this is solvable engineering using things like heated hydraulics and sealed bearings.
Will the sand support that weight?
Remember this thing weighs about 1000kg:
Your 20 tonne robot needs 2 feet about twice as wide as the wheels on Curiosity.
Those wheels are 40cm wide, but the rover is riding quite high normally - only about 1-2cm of the wheel touches the surface in normal (non-bogged) operation - each wheel is using about 60 sqcm of surface area at any one time, ~360sqcm total for the entire 1 tonne rover.
Multiply it out for a 20 tonne robot, 7200sqcm needs to touch the ground to support that weight. That's 0.72 square meters. Allowing 1 foot to be in the air while walking, square feet of 85cm should support a 20 tonne bipedal walker robot on mars.
Could you use them? Sure! Does it make sense? Not really.
In my answer to Advantages of "Spider Mechs" over Tanks? I point out that legs are useful for one thing: agility. For all other purposes they're terrible. They cost more, are harder to repair, and can have far more things go wrong with them than simple treads.
On something like the Mars Rover where energy is very, very limited and even minor obstacles on the ground can hang up travel, basic articulation (in this case independent wheels on independent suspension) is OK, even necessary.
But you're talking about something that's big enough to not honking care about even moderately large rocks. At 20+ tons, they'd just roll over the top of most things in their path — and we're assuming the highly restrictive energy limitations of Rover (which is run on solar panels... combat vehicles do not) do not apply with your vehicles.
Consequently the practical answer is no. No one in their right mind would ever use articulated legs on a large vehicle.
But that hasn't stopped a LOT of really cool stories, movies, and games from taking the idea and running with it. What they do is ignore all the problems and focus only on the benefits — which makes everything from Battlemechs to Jaegers to Gundam and even Voltron happily (and in many cases, lovingly!) embraced.
Ignore anything anyone says here and write your story or build your world. Does it make sense to use walkers on Mars? Nope. Should you do it? Absolutely! Want help working out the details of the design? We'd love to help!
But try not to ask if fictional things make sense or are believable. In real life, most of fiction and fantasy will never make sense (which is boring!) and the whole goal of writing is to suspend disbelief. Do you remember the phrase, "build it and they will come?" That's what we live for, here.
Let's build those walkers!