In general, most microcontrollers have had In Circuit Serial Programming (ICSP), e.g. where a programmer like the PICkit 3 is connected to a PIC microcontroller, and a binary image of the code is programmed into the microcontroller's program memory using a dedicated programming interface (in the case of PICs, an data line PGED and a clock line PGEC).
Before flash memory came along, the program memory could take the form of PROM (programmable read-only memory), EPROM (erasable PROM), or EEPROM (electrically erasable PROM). The latter (EEPROM) is functionally the same as Flash memory today, from a programming standpoint. Straight PROMs could only be programmed once. Processors with EPROM had little windows on them, and the program could be erased in 20 minutes or so using UV light. EPROMs without a window were also sold as OTPROM -- one time PROMs.
Before microcontrollers had programmable memory and ICSP, any on-chip program memory was stored in ROM and could only be programmed by the factory. This was used for large volume production which could justify this. The customer would supply a binary file to the factory containing the program. If there was a mistake after the chips were fabricated, all of the chips would have to be thrown out.
So before the ROMs were made, the program would typically be checked out using an In-Circuit Emulator (ICE), in which the microprocessor and/or program code memory chips would be replaced by a socket, and a large cable connected the socket to the ICE. This allowed the program to be downloaded to the ICE and checked out, before the chip was programmed -- it was similar to working with the JTAG interfaces used today, the difference being the typical ICE cost around $5000 in 1970's dollars.
Before microcontrollers, there were microprocessors; the difference being there was no program memory on chip -- instead, the microprocessor had external address and data busses, and the program memory was contained in an external ROM, PROM, EPROM, or EEPROM chip. The latter three could be programmed by the customer. External memory chips using ROM would also be programmed by the factory. This dates way back to the 4004, which was the first microprocessor.
The 1702 (shown earlier) was one of the first EPROMs and could store 256 bytes of program code. The 2764 with 8 KB of program code was another popular chip later on. These chips would be programmed using an external programmer connected to a PC. (Some of the programmers also contained keyboards where you could enter the code by hand, or patch code that had been download.)
You would program the chip(s) needed by your program, then plug them into sockets on your board. The program either ran or it didn't due to bugs. There were no breakpoints available unless you were using one of those multi-thousand dollar ICEs.
If the program had a bug, you would try to fix it, program a new set of chips and repeat. Because of the lack of breakpoints, printf's to a serial UART were often used, as well as blinking LEDs or using an oscilloscope to look at other processor pins. If you ran out of chips, you might have to wait 20 minutes to erase them under a UV eraser.