It is a VERY dangerous operation to be sure, but they needed to extinguish the fire before they could cap the well. In large explosions like these a momentary void without oxygen is created, robbing the fire of a much-needed source of fuel -- the fire needs both the oil and oxygen to burn. When the void is created, it snuffs the fire out. It's a very old technique, dating back to the first days of oil drilling, and the process has changed very little. Oil workers back then would fill large barrels with sticks of dynamite and move them on long beams into the fire and wait for them to explode. It would also have the effect of collapsing the well, temporarily plugging it so they could install a pump.
In this movie, we see a large construction crane carrying the barrel to the fire. The modern technique is probably much safer but it's still an extremely dangerous operation.