Most car Engine Control Units have tables of data inside them which stores all kinds of parameters. Some parameters may be modifiable (sometimes for example you can change settings to convert from manual to auto).
Often there is a special category of settings which is normally only written once when fitted to the vehicle such as immobiliser data and VIN number.
The rest (and vast majority) of the information is normally only either written at the factory, updated at dealerships or modified by tuning companies.
This thread will cover the concepts behind the general techniques available.
1. FLASHING VIA OBD
Most ECUs from 2000 to 2008 (and many of them even after 2008) are flashable via OBD plug. OBD is a communication port in most cases hidden somewhere under the steering wheel. You plug a special interface into your laptop and this port to let you read out the ECU dump, then once modified, flash the file back over the same cable. This is the easiest and the fastest way of reprogramming the ECU. However it is recommended to use a regulated power supply connected to the vehicle that is intended for the task (which does not mean a regular battery charger).
2. FLASHING VIA BDM PORT
Most ECUs from 2002 to 2008 (and some later) have a special communication port on the motherboard called a BDM port. To access this port You need to take the ECU out of the car and open it. Once you are ready you have to power it up using your own regulated 12v PSU. BDM is one of the most stable ways to flash an ECU because the ECU receives stable 12V power, and can normally be flashed over and over again. BDM is also used for backup if something goes wrong with the flashing via OBD.
3. FLASHING VIA BOOT MODE
Flashing via "boot mode" is a procedure of taking the ECU out of the car, and programing it on the table while connecting special cables to the ECU's connector pins. Sometimes You also need to do some soldering, like adding resistors to the motherboard or similar. There were early ECU's which were often very simple to put into boot mode. Newer vehicles often have much more complicated ECU's such as the TriCore which are not a task for the beginner.
4. SOLDERING AND EEPROM FLASHING
Soldering is used mostly for older car ECUs and have to be used for a big percentage of truck ECUs. This is the procedure where you take the ECU out of the car, open it and desolder out the EEPROM chip. You then need to read out this chip using an EEPROM programmer like Beeprog or Labtool. After read, file is modified and then programmed back on a chip (or on a new, empty one). Then you solder the chip back into the ECU.
Please note that even simply the act of flashing any form of small computer including an ECU has inherent risks. Opening up a modern ECU can damage it beyond repair unless you are practised. Attaching temporary wires internally has risks involved. Modifying the software of your ECU will likely render your warranty void as well as your insurance unless declared.
I thought this thread would go well with another thread Big-Ted posted. If there is any interest in this I will add a little more.