Can I mix DDR3 1333 MHz memory with 1666MHz memory on my iMac?
You can mix memory speeds so long as the memory is faster than the memory specified for your computer.

The 2012 iMac calls for PC3-12800 DDR3 and the minimum RAM speed is 1600Mhz (all models iMac in 2012; 21" and 27").  So, the 1666MHz RAM will work, but the slower 1333MHz RAM will not. Many, many years of experience has told me not to mix RAM speeds.  While it is "supposed" to work just fine, some memory modules aren't very tolerant and can cause issues.  Stick with what's recommenced for best reliability.