Atmega1280 or 2560

If I had a 40 pin DIP Atmega1280 on a breadboard, would I be able to program it using the Arduino IDE if I select board "Arduino Mega" ?

Just to clarify, I have programmed in a similar manner the DIP Atmega328 running with its own internal clock, I think I only needed a pull up for the reset line. If I remember correctly I downloaded the compiled sketch straight to it, no bootloader, and it worked fine.

Yes. Except that the ATmega1280/2560 comes in a 100pin LQFP package, and not a 40pin DIP.
You might be thinking of the ATmega1284, which is in a 40pin DIP. However, that would NOT be compatible with the "arduino mega" board type.

40 pin DIP is a board type by itself.

Bobuino board type for boards I offer, couple of examples:
http://www.crossroadsfencing.com/BobuinoRev17/