They form, like all vortices in whatever medium, when two masses in different states meet at speed. With tornadoes, warm moist air is meeting cold dry air in the turbulent conditions of a supercell thunderstorm. During wildfires, the intense heat and turbulent contrast with the surrounding air can be enough to create these twisters, and sometimes sustain them for quite awhile. The vortex also sucks up combustible gases from the fire (such as evaporated tree resin), which ignites in the oxygen rich centre of the vortex, giving the twister another dose of energetic fuel. They can also spread the fire by whirling burning debris far and wide.
A similar phenomenon was responsible for the Hamburg firestorm in 1943, when several days of incendiary bombing ignited a self sustaining enormous conflagration that took weeks to burn itself out fully.
Should any of our readers ever see one of these, do NOT go closer in order to get a photo, they behave unpredictably, and discretion being the better part of valour, please run away as fast as is safe. Bushfires in general are best avoided at all times, unless you're a dedicated fire fighter.
Image credit, taken in Missouri: Janae Copelin/Barcroft USA