Fire was useful for all kinds of things in the ancient and medieval world, but it was also very dangerous. Because people built their houses of wood, and had thatched roofs, and then built fires inside their houses to cook on and to heat their houses, it was very common for their houses to catch fire and burn down.
And, because villages had lots of these wooden houses close together, often when one house caught fire, the whole village would burn.
In the ancient world, they didn't have fire departments, so there was nobody to put out a fire once it got started. The Romans tried to make some rules about how close together houses could be, and they made a law that every building had to have buckets of water standing around in case of fire, but a lot of people probably didn't follow these rules. Even if they did, a few buckets of water wouldn't be enough to stop a house fire.
One example of a very serious fire is the Great Fire of Rome in 66 AD.