That's a big topic. If you stick to a fairly well defined kind of bike (road racing or gravel) and the most current version of it, and you buy the fork/headset with the frame, your main compatibility issues come from bottom bracket type. Which may or may not be an impediment (some BB types can be adapted to any kind of crank). Then the other issue are bikes set up for electronic shifting only, vs either mechanical or electronic.
But if you get an older frame, or one of the many less defined kinds of bikes, then you'll run into issues with brake mount type, chainline/bb width/hub width etc.
So before this thread gets out of hand, why not narrow down what you're thinking of getting.