If I grab any Atmel AVR-based microcontroller off the shelf, will I be able to write code for it using the Arduino SDK?
Arduino SDK (i.e. Arduino core and default shipped libraries), supports a specific set of boards, which in turn use a specific set of AVR8 microcontrollers. This is a subset of total set of AVR8 microcrontrollers that ATMEL sells. The various AVR8's, use the same instruction-set as you might already be aware, but vary in terms of maximum clock speed, SRAM + flash sizes, peripherals and pin-count. The Arduino core software takes care of those differences, but only for the AVR8's that are used in the supported set of boards.
So, if one designs their own board, using an AVR8 that is also used in a supported Arduino board, and you have a way to (re-)program this microcontroller, then they are about as good as the original supported board, from the Arduino board family. This is what all the "Arduino" clones in market are.
As for the rest of the AVR8's, the support for them can be added by creating custom Arduino core, and libraries. For example 'MIT - High Low Tech' attiny85 core, or Arduino-Tiny core for attiny85. There are other similar user-contributed/generated custom cores.
Note that AVR8 microcontrollers also have a hardware signature, which identifies the part-number. This is something which is checked by the programmer at the time of programming the part via ISP.
Some people consider the Arduino IDE as part of that SDK. Do note that the IDE can be used to write programs for, and program any AVR8, for as long as core/libraries for the AVR8 have been added, a "boards" definition created to enable compilation and programming of the uC.