If you don't use a remote with your iMac ever, you can turn off its reaction to an IR remote by going into the Security preferences and checking the box that says "Disable remote control infrared receiver". You have to do this even if you go through the pairing sequence described in the docs linked to above. A remote operates the device its paired with AND any device not specifically paired with anything.
If you do want to use a different remote with it, you'll need to pair a remote with each device so they are married to one device only.