As a hazard
Has a destructive capability against anything flammable close to it and may expand to large extensions if left unattended. Note that colonists capable of Firefighting will only fight fires in your Home area. To make them fight fires outside of this area, use the "Expand home area" tool in the Zone/Area section of the Architect menu.
Fire spreads through little flames flying nearby, a good way to avoid burn damage in your colony is to lay down stone flooring on the wall outer sides by a width of three tiles minimun.
Animals or Colonists
Caught on fire will become momentarily disabled by panic and attempt to extinguish their fire, while also wander into unsafe open areas where they might be vulnerable to attacks.
At higher temperatures (~235C/455F/508K), flammables can spontaneously ignite, and an orange haze effect will appear.
Caught on fire will take damage over time. The damage taken value is the same for everything, however how big the fire will be depends on the flammability of its material.
As a tool or weapon
Countermeasure against Infestations
Infestations are difficult to clear, especially when spread through multiple (mined out) caves.
An effective method is to equip a colonist with an incendiary launcher or Molotov cocktails and attack the hives one at a time. Without hives, insects will no longer be hostile.
Should one of your caves have power conduits running through all the area and completely sealed with roof, they could be used to spread the fire by closing the caves with walls and then simply shoot at a conduit to ignite. Insectoids will collapse and eventually die of burns or heatstroke, hives will ignite if the temperature reaches threshold.