What is this yellow thing on the board?
The component you're describing is a tantalum capacitor. Read more here. It works like a regular (e.g. electrolytic) cap, probably in this circuit its function is to make the power supplied to the device "cleaner", as the GPRS module may draw lots of current in short bursts, so the capacitor acts like a short-term power reservoir. The tantalum caps allow for much more capacitance per unit of volume than electrolytic ones, but they're notorious for their narrow voltage tolerances and a spectacular thermal failure mode, which you've witnessed. Basically if you abuse them they burst into flames, sometimes sending small pieces of flaming material into the air.

It's much better for the board you if you replace it with a working one.

As per the general safety question, the technology of tantalum caps is safe enough to put them in nearly all mobile phones nowadays (as phones are too small to allow for an electrolytic cap). But in the hobbyist setting there have been cases of exploding products due to poor circuit design. Most famously and Arduino GPRS or GPS Shield (the official, branded one) designs from a few years ago had a lot of exploding specimen.