The iMac uses a standard PC power cord, and has for every generation except the G4.
You can reuse the cord if you wish. You could use an iMac G3's multicolored cord if you wanted. At work we have several iMacs and Mac minis and the Apple power cords are long gone (lost, damaged, whatever happens to them nobody knows). We use standard PC power supply cords for the iMacs and for the minis, we typically use cables scavenged from old printers, Lenovo laptops, etc.
You won't fry your iMac by using the old cord. Nor will you fry it if you use a cord from an HP, Lenovo, or other PC desktop. The only danger here is if the cord is damaged and the wires are frayed; then you could certainly damage your iMac (or start a fire, or both).