Hi Navneet.
I can only think that your macOS is damaged or the recovery partition is missing, and this is why you cannot boot into Recovery Mode.
You could try booting into Safe Mode one-time and see if that fixes the problem.
At the Start Up chime hold down the Shift Key and keep the key pressed until you see the message "Safe Mode" displayed on-screen or you see the user login window appear, then release the shift key and wait while the Mac boots all the way to your desktop view, this will take a long time and you may be asked more than once to enter your login password, please be patient, it may take up to ten minutes before the user desktop appears.
After the desktop appears wait another ten minutes then restart the Mac, when you hear the Start-Up chime press and hold the Command and R keys until the Mac boots into Recovery Mode.
If this still fails then the simplest solution is to create a bootable installer for the version of the macOS that you want to return to, or that is currently installed, using an external hard drive connected to one of your other Apple computers, follow the link below for details:
https://support.apple.com/en-gb/HT201372
Then boot your iMac using that external drive, which will allow you to reformat the existing internal drive and reinstall a clean macOS that is not registered to you.
When you boot for the first time after carrying out this process you can restore your user settings, apps and data from a Time Machine backup or shut down the Mac for disposal or trade-in.
If you intend to dispose of, or trade-in the Mac, make sure that you logout of your iCloud and App Store accounts on the Mac while it still allows you to boot into normal mode and before you boot to the external drive for a clean re-install of the OS.
HTH.
Will.