Mammals have four legs because their early synapsid ancestors had four legs. Those early synapsid ancestors had four legs because their early amphibian ancestors had four legs. Those amphibian ancestors had four legs because their lobe-finned fish ancestors had four fins.
So mammals (ancestrally) have four legs, not because four legs are the bestest possible number of legs for a mammal to have, but because some fish back in the Devonian period with four fins decided to thrash from one dried up puddle to another slightly less dried up puddle.
Plenty of mammals have stopped using some of their legs as legs and instead for some other purpose, or have lost some of their legs.
So we see that the mammal body plan is highly dependent on the unique evolutionary history of mammals. Even if complex life evolves on some other planet, it is not going to recapitulate the contingent evolutionary history of life on Earth.
But on the other hand, we can make a few guesses, because the body plans of animals on Earth are a response to the physical environment of Earth, and any planet with life is going to share some of those physical characteristics. Such as gravity. Gravity gives creatures a top and a bottom, and we find that the top and bottom sides of animals on Earth are almost always different. This gives rise to radial symmetry.
Animals frequently move around, this means they move in a direction. If they have sense organs or mouths, the creature needs more information about where they are traveling to. They move to things they are going to eat, which means the mouth is on the front, and they move away from things they excrete, which means the anus is at the back. And so gravity and movement combine to create bilateral symmetry and cephalization. Radial symmetry is much more common in sessile creatures than in motile creatures, and there are plenty of motile species that have a radially symmetric body plan that was secondarily modified into bilateral symmetry. Cephalization just means that sense organs and brains cluster on the front of the animal.
Bilateral symmetry with a mouth and sense organs near the mouth isn’t much to go on, but it’s about as much as we can say about alien life.