Welcome to the Apple Support Communities.
Yes, you can do that. I would suggest getting a USB external SSD, since Thunderbolt 1/2 cannot be found anymore. A great choice is a G-Technology G-DRIVE mobile SSD R-Series Storage - Apple.
You cannot use Apple's Thunderbolt adapter, because it is for Thunderbolt 3 only (not USB-C), and the Thunderbolt 3 device must provide its own power, and almost all Thunderbolt 3 SSDs are bus powered.
Here's how to put the latest version of macOS on an external SSD:
- Connect the SSD to the iMac.
- Shut off the iMac, turn it on, and immediately press and hold "Option" + "Command" + R.
- Once in macOS Recovery, connect to WiFi in the top right corner. If possible, connect directly to the internet with an Ethernet cable.
- Go to Disk Utility.
- IMPORTANT: Select "View" > "Show All Devices".
- Select the main SSD drive. It will be the top, non-indented drive in the "External" section. Its name will end in "Media".
- Click "Erase", and input the following:
- Name: Could be anything, or a name such as “Macintosh HD”.
- Format: APFS
- Scheme: GUID Partition Map
- Click Erase.
- Quit Disk Utility.
- Select "Reinstall macOS".
- IMPORTANT: Make sure to select the new external SSD as the installation target for macOS. External disks are orange and silver in macOS.
- Let the installation process complete.
- During Setup Assistant, you can choose to transfer data from your internal drive or not. Follow the on-screen steps to move your data from the source to the new macOS on the SSD if you wish.
Cheers,
Jack