Using Atmega 328P barebone with non-standard crystal oscillator
I’m assuming you’re using the Arduino IDE here... which I realize might not be what you’re looking for.

It’s possible to use any crystal or ceramic oscillator up to 20MHz with the right capacitors (or no capacitors if you use a ceramic oscillator with built-in caps). You could also use the internal 8MHz oscillator.

You could use a non-standard bootloader like minicore.

Minicore supports 12MHz out of the box, in addition to other non-standard crystal frequencies and will make sure all timing-sensitive things like millis(), delay() and baud rates will still work correctly.

First, you need to install the Minicore Board Manager as described in the page I linked to.

Then you need to flash the Minicore bootloader to your ATMega.

24, 27 and 33MHz are beyond the ATMega328 specifications so I don’t recommend those (except if you’re feeling lucky, but you risk bricking your ATMega).