Sorry if this is a stupid question, but would it be possible to modify the Arduino bootloader to work on different AVR chips? For example, would one be able to edit the bootloader to make so that I could program a 20-pin AVR (for example) using the Arduino code and environment?
A "bootloader" is essentially a software implementaion of a programmer and to put a bootloader on any chip you would need an external programmer. The Arduino environment will also support uploading applications directly through external programmers (Duemillanove and other Arduino specific boards included). So once you have an external programmer (needed for the bootloader upload) you don't really need the bootloader anymore to program your sketches.
The Arduino core and contributed libraries are specific to a few AVR chips (AtMega series) so you should expect to have to port/rewrite the Arduino sources to match your AVR of choice. Some ports exists, but it is my impression that most (if not all) fall into the "development in progress .." category.
I would argue that once you reach the level of competence required to develop for other AVR's including porting code and working with external programmers you're likely to be better off with alternative environments.
Alright, thanks. I was just wondering if it was feasible or not
The answer is yes, but the choice of AVR's is limited to ones with enough flash, and a reasonably similar USART (to minimise the amount of code you need to rewrite).
Is their a specific reason why it must be the Arduino bootloader, rather than any other AVR bootloader?
You might want to look at V-USB. Which goes one step further and implements a USB interface on ordinary AVR's which don't have USB hardware.
There are a set of V-USB-based programmers which don't need a USB chip. One uses an ATmega48 so that it can program itself over USB, without a USB chip.
I would tend to go with BenF, and just use an ordinary programmer unless you have a special reason to do it differently.
You might also look at USBtiny, which Ladyada uses as a basis of her USBtinyISP.
For the cost of parts (a few dollars) you could have a programmer without using up resources on chip for a bootloader, but note, AFAIK there is no support for something like the Arduino's serial communication over USB using them.
This is a rather different approach to the Arduino's, with some restrictions, but it may be valid for your needs.