Before the extremely accurate machines were made, they first had extremely accurate measuring devices.
I'll use the "first lathe" as an example. The bed of the lathe needs to be very flat, as the rest of the machine can be calibrated with it. One way it can be made that way is by putting the not-straight bed up against a much flatter surface plate, and scraping off the high spots on the lathe bed until they meet perfectly.
The flat surface plate must have come from someplace, and from what I recall they make it by taking at least 3 somewhat flat plates and lapping them with each other. Eventually all the plates will end up very flat.
With a flat enough surface you can make make extremely straight measuring instruments, pair it up with a simple surface gauge and you can start producing items with extremely parallel surfaces. Rolling a round bar on the plate can check how straight it is, and the surface gage can detect taper.
Now with the straight round bar you can use that to align the axis of rotation to the bed of the lathe, thus creating the first rudimentary lathe.
The accurate lathe bearings were probably done the babbitt bearings way where you hold the rotating shaft/part in place and cast the bearing from molten lead around the bar, then you forcefully twist the bar creating a virtually zero clearance bearing. Fairly accurate if done properly and it can deal with slight misalignment of the hole drilled in the lathe head and the axis of rotation.