It does not explode because the internal resistance is extremely small , about 1.2 mOhm at 25c according to the datasheet (see page 4, primary conductor resistance ) :
http://www.allegromicro.com/~/media/Files/Datasheets/ACS712-Datasheet.ashxPower dissipated in the chip from just this current would be P = IxIxR = 20A x 20A x 0.0012 ohm = 0.48 watts. This is a substantial for a plain SOIC chip, but not really a killer.
With some wide pads on the pcb and some space around the chip, the chip will radiate the heat away and stay cool and everything would work fine. Of course, as it heats the measurement will drift a bit, the resistance itself may deviate a bit from that exact 1.2 mohm, basically just because the IC says it can measure up to 20A, it doesn't mean it's fine for you to use it to measure currents up to 20A for long periods of time.
Alternatively, you could always go for a small heatsink on the IC itself, though it wouldn't do much cooling.