Electrical breaker and outlet wiring question
You can run a 20A breaker and 12-2 copper (with ground, but that's a given unless you have found some antique wire) to a single 20A receptacle for any purpose. Including an air compressor.

However, for an air compressor "dedicated circuit" the FIRST question I'd ask is whether the motor can be converted to run on 240V, and if it can, I'd strongly suggest doing that unless you have strong reasons not to (such as this being a portable compressor that you often take to job sites where 240V is hard to come by.)

If that is the case, I'd then look at provisioning a 240V (two-pole) breaker of appropriate amperage to a 240V outlet of the appropriate amperage rating on appropriate size wire for that amperage (or 12/2 if you are already sitting on it, even if it's larger than needed for 240V and fewer amps.) Rewire the compressor for 240V operation and install the matching plug.