Re. reformat: if the used machine is running Lion or Mountain Lion and the originally installed OS was a previous one (in other words, the OS was upgraded/purchased from the app store), then the answer is: No, you cannot reformat or reinstall - not until you install your own copy of Lion or ML using your own Apple ID. Tryint to reinstall will result in Apple's servers asking for the original Apple ID used to purchase it. The license for that OS is not transferable and is tied to the original purchaser's Apple ID forever. So, you will need to get the original install disks, boot from it, wipe your drive, reinstall the OS and then go to the app store to purchase the new OS.
And, re.FCPX - if it was purchased from the app store, you can download it again. I have not tried what you want to do, so I do not know if that would work or not. The safe way would be to download on the new machine. If it was purchased via retail disks, then different rules would apply. If your copy was on the iMac when you purchased it (and unless you were given the install disks), then the same rules apply as above: you do not have a legit copy of it as the license for any app purchased at the app store is not transferable either. So, you will need to buy it.