You don't need a Thunderbolt drive. Almost all external CD/DVD drives are USB, and they work fine on an iMac's Thunderbolt/USB-C ports, since those ports accept USB-C devices. Apple's own USB SuperDrive is discontinued, so look for a USB-C drive from a known brand (Pioneer, LG, ASUS). If it only has a USB-A plug, add a USB-A to USB-C adapter.
To rip: insert a CD, open the Music app, choose File > Import > CD, and click Import Settings to choose a format (Apple Lossless is a good choice for quality).