The largest self-powered vehicle in the world is the NASA crawler-transporter, a 2700 ton machine designed to transport the Space Shuttle a short distance and in a straight line.
During WW2, German engineers designed the P1000 Ratte, a ridiculously huge thousand-ton supertank. It was never built, and likely would have been a complete waste of resources. It would have been extremely vulnerable to bombing, and would have severe difficulty traversing the landscape of continental Europe.
Fictionally, the larger vehicles of Homeworld: Deserts of Kharak appear based on the aesthetic of the crawler-transporter, but scaled up to ludicrous size. Note that the dune buggy-like vehicle in the lower right is large enough to have a multi-person crew, for reference.
In the real-world, megavehicles like these are militarily non-viable. They would be vulnerable to airpower and tactical nuclear strike, incapable of traversing bridges or following roads, and offer no apparent benefit over a convoy of more specialized vehicles.
Deserts of Kharak appears to attempt to address these issues through its worldbuilding- the setting is a massive desert without bridges or roads, airpower is minimal because of sandstorms, and the extreme heat of the desert requires that vehicles be reasonably self-sufficient (ie crews cannot make camp outside their vehicles, and must live onboard 24/7). The technological base is science-fictional, but not dramatically more advanced than the present day in most respects, with the exception that nuclear weapons are not available.
My naive intuition is that if armor is viable as protection, the square-cube law favors larger vehicles as they gain greater protection for an equivalent armor mass fraction. However, by the same token, ground pressure increases at the same rate, and in sandy terrain that becomes a problem. I'm assuming that any realistic take on this concept will at least need much more track surface than the crawler-transporter or Deserts of Kharak vehicles, for the sake of ground pressure.
Do these conditions actually favor very large land vehicles for military use? If not, what are the minimum changes necessary to the environment or technological base to make such megavehicles practical?