Yeah…you can't install macOS on an iMac with an installer disk for a MacBook Pro.
This is the iMac you have:
Technical specifications for the iMac "Core 2 Duo" 2.66 20" (Early 2009). Dates sold, processor type, memory info, hard drive details, price and more.
everymac.com
The unknown variables are how much RAM is installed and what sort of hard drive it has (it came with a mechanical, spinner hard drive).
Officially, the latest version of macOS it will run El Capitan (macOS 10.11.6).
There are methods to install later versions of macOS (OCLP, dosdude1). You probably need 8GB of RAM and an SSD to run anything like that. An external SSD would do.
But to get macOS on there, at a minimum, you need to make a USB thumbdrive installer of one of the Apple approved versions of macOS. You might even find obstacles to that…hurdles that have come up over the years affecting valid installations on older Macs. Research is your friend.
Another thing you could try is making a compatible USB installer for a Linux disto. More research.