I work with an old toolmaker who also worked as a metrologist who goes on about this all day.
It seems to boil down to exploiting symmetries since the only way you can really check something is against itself.
For example, you can check a square by aligning one edge to the center of straight edge and tracing a right angle, then flip it over, re-align to the straight edge while also trying to align to the traced edge as best you can. Then trace it out again. They should overlap if the square is truly square. If it's not, there will be an angular deviation. The longer the arms, the more evident smaller errors will be and you can measure the linear deviation at the ends relative to the length of the arms to quantify squareness.
A lot of other angles can be treated as integer divisions of 90 degree angle which you obtained via symmetry. For example, you know two 45 degrees should perfectly fill 90 degrees so you can trace out a 45 degree angle and move it around to make it sure it perfectly fills the remaining half. Or split 90 degrees into two and compare the two halves to make sure they match. You can also use knowledge of geometry and form a triangle using fixed lengths with particular ratios to obtain angles, such as the 3-4-5 triangle.
Similarly, you can produce flat surfaces by lapping two surfaces against each other and if you do it properly (it actually requires three surfaces and is known as the 3-plate method), the high points wear away first leaving two surfaces which must be symmetrical, aka flat. In this way, flat-surfaces have a self-referencing method of manufacture. This is supremely important because, as far as I know, they are the only things that do.
I started talking about squares first since the symmetry is easier to describe for them, but it is the flatness of surface plates and their self-referencing manufacture that allow you to begin making the physical tools to actually apply the concept of symmetries to make the other measurements. You need straight edges to make squares and you can't make (or at least, check) straight edges without flat surface plates, nor can you check if something is round...
After you've produced your surface plate, straight edges,and squares using the methods above, then you can check how round something is by rolling it along a surface plate and using a gauge block or indicator to check how much the height varies as it rolls.
EDIT: As mentioned by a commenter, this only checks diameter and you can have non-circular lobed shapes (such as those made in centerless grinding and can be nearly imperceptibly non-circular) where the diameter is constant but the radius is not. Checking roundness via radius requires a lot more parts. Basically enough to make a lathe and indicators so you can mount the centers and turn it while directly measuring the radius. You can also place it in V-blocks on a surface-plate and measure but the V-block needs to be the correct angle relative to the number of lobes so they seat properly or the measurement will miss them. Fortunately lathes are rather basic and simple machinery and make circular shapes to begin with. You don't encounter lobed shapes until you have more advanced machinery like centerless grinders.
I suppose you could also place it vertically on a turntable if it has a flat squared end and indicate it and slide it around as you turn it to see if you can't find a location where the radius measures constant all the way around.
You might have asked yourself "Why do you need a square to measure roundness above?" The answer is that squares don't just let you check if something is square. They also let you check indirectly check the opposite: whether something is parallel. You need the square to make sure the the gauge block's top and bottom surfaces are parallel to each other so that you can place the gauge block onto the surface plate, then place a straight edge onto the gauge block such that the straight edge runs parallel to the surface plate. Only then can you measure the height of the workpiece as it, hopefully, rolls. Incidentally, this also requires the straight edge to be square which you can't know without having a square.
More On Squareness:
You can also now measure squareness of a physical object by placing it on a surface plate, and fixing a straight edge with square sides to the side of the workpiece such that the straight edge extends horizontally away from the workpiece and cantilevers over the surface plate. You then measure the difference in height for which the straight edge sits above the surface plate at both ends. The longer the straight edge, the more resolution you have, so long as sagging doesn't become an issue.
From these basic measurements (square, round, flat/straight), you get all the other mechanical measurements. The inherent symmetries which enable self-checking are what makes "straight", "flat", "round", and "square" special. It's why we use these properties and not random arcs, polygons, or angles as references when calibrating stuff.
Actually making stuff rather than just measuring:
Up until now I mainly talked about measurement. The only manufacturing I spoke about was the surface plate and its very important self-referencing nature which allows it to make itself. That's because so long as you have a way to make that first reference from which other references derive, you can very painstakingly free-hand workpieces and keep measuring until you get it straight, round or square. After which you can use the result to more easily make other things.
Just think about free-hand filing a round AND straight hole in a wood wagon wheel, and then free-hand filing a round AND straight axle. It makes my brain glaze over too. It'd also be a waste since you would be much better off doing that for parts of a lathe which could be used to make more lathes and wagon wheels.
It's tough enough to file a piece of steel into a square cube with file that is actually straight, let alone a not-so-straight file which they probably didn't always have in the past. But so long as you have a square to check it with, you just keep correcting it until you get it. It is apparently a common apprentice toolmaker task to teach one how to use a file.
To make a sphere you can start with a stick fixed at one end to draw an arc. Then you put some stock onto a lathe and then lathe out that arc. Then you take that work piece and turn it 90 degrees and put it back in the lathe using a special fixture and then lathe out another arc. That gives you a sphere-like thing.
I don't know how sphericity is measured especially when lobed shapes exist (maybe you seat them in a ring like the end of a hollow tube and measure?). Or how really accurate spheres, especially gauge spheres, are made. It's secret, apparently.
EDIT: Someone mentioned putting molten material into freefall and allow surface tension to pull it into a sphere and have it cool on the way down. Would work for low tech production of smaller spheres production and if you could control material volume as it was dropped you can control size. Still not sure how precisely manufactured spheres are made though or how they are ground. There doesn't seem to be an obvious way to use spheres to make more spheres unlike the other things.