A few years ago, the charging port in my Samsung Galaxy S7 caught fire while charging in my car. Luckily in this case I was present, and was able to disconnect the phone when I smelled the smoke. The fire just fizzled out as soon as I disconnected the charger. In this case it wasn't the battery burning, but something else in the system. It took a bit of arguing with the technician at the Samsung store, however in the end they just replaced the phone. In this case there was no damage to anything else, so I was happy with them just replacing the phone.
That is commonly caused by bad contacts, which have a high resistance and thus dissipate heat, which then leads to higher resistance, more heat, etc. The tendency of manufacturers to make each generation of connector smaller and with more fragile contacts, for aesthetic reasons, certainly doesn't help.