Make sure the repair shop installs a temperature sensor adapter when installing a non-Apple drive or the system fans will run at full speed. These temperature sensor adapters can be purchased from OWC. I'm not certain if this model iMac requires the adapter or not. Check OWC to see if your iMac needs it.
Whether you can use your wife's Time Machine backup to restore to the blank drive on the 2012 iMac will depend on the OS on the Time Machine backup drive. I don't use Time Machine so I am not certain if it will work. I also do not know whether the Time Machine drive has an option to reinstall macOS if you were to boot your Time Machine backup drive.
See if your iMac can boot into Internet Recovery Mode using Command + Option + R. While you can use WiFi for Recovery Mode, connecting the computer directly to the router using Ethernet is faster and more reliable.
If you cannot boot into Internet Recovery Mode using any of the key combinations, then download and create a bootable macOS USB installer on your other Mac.
Edit for link for creating a bootable macOS USB installer:
https://support.apple.com/en-us/HT201372
Once you boot into Recovery Mode or from a USB installer or even Time Machine drive, then launch Disk Utility and erase the new drive using GUID partition and macOS Extended (Journaled). If the physical drive does not appear in the left pane of Disk Utility, then click "View" and select "Show All Devices". After the new drive is properly erased, quit Disk Utility and select "Reinstall macOS".