Great question. There is a _lot_ of archaeology on ancient mills, they're often well preserved structures, and we have plenty of examples of mils with traditional technologies operating up to the present day, so we can watch them working-- and you're right, explosion seems to have been rare; it may well have happened, but it doesn't appear to be a commonly perceived threat. This is also one of the rare topics where we have written material on ancient engineering, Vitruvius has a lot to say about mills.
Gristmills were small by modern standards, and they were draughty. Explosions seem to be more a problem of the modern era, when the mills-- and their storage-- get very large, and there are attempts to seal them (to keep out pests). Typically, the mills would have been driven by muscle (human or animal), water or wind power, in both cases a natural solution to the problem, and naturally keeping the scale fairly small.
In the past, anyplace you'd have had a mill would have had substantial airflow. Consider for example the famous Roman mills at Barbégal. They're driven by waterpower, and a remarkable achievement of ancient engineering
Barbegal was an immense flour mill, probably dating from the fourth century A. D. The power to drive the millstones came from 16 waterwheels, arranged in parallel rows of eight. Each row ran downhill so that the water cascaded from one wheel to the next, driving all eight in turn before running into the drain at the foot of the hill and thence discharging into a marsh 500 meters away. The ingenuity of the arrangement is self-evident. In the medieval and later ages it was not uncommon to build water mills one after the other along the course of the same stream; here they were consolidated under a single roof to form a veritable factory. One may also admire the design from the opposite point of view, for the power sources were cleverly dispersed. It would have been impossible to drive so many machines with a single wheel because the friction of the belt drive, or any other means of transmission, would have proved too great a load. Multiple grinders became possible only when each millstone was provided with a waterwheel of its own.
Cold stream water pouring through on a summer day means higher humidity and natural airflow, and waterwheels are necessarily drafty in operation, that is there'd be a lot of rotary machinery moving air (not sure how much that would contribute).
With mills that used humans or animals as power, there'd have been a big incentive to keep them breezy; neither man nor beast working in the summer heat does so efficiently in a sealed room!
[Edit: there are a lot of excellent contributions in the comments below, one that I should add here is the very limited on site storage at older mills. When you hear "a mill explosion" -- most often that's from a stored commodity, not from the manufacturing volume; older mills didn't have grain elevators and so on-- they were typically moving the flour out of the mill very quickly to bakeries. People shipped corn and wheat, but I don't know that they shipped shiploads of flour]
Traditional watermills were used until quite recently in Turkey, so there's a chance to see traditional technology in action-- the scale is much smaller, and the ventilation much different than a modern mill. At the same time, loss to pests must have been very high, some estimates of loss to pests go as high as %40, compared to a modern %5. Its when you add more power, reduce ventilation and store more flour (or other combustible commodity) that explosion hazard grows.
Reading Vitruvius, it seems -- though this is somewhat conjectural, depending on a tricking reading that suggests a "kneading machine"-- that flour was converted to dough onsite, meaning that it didn't sit long in its dusty flour form, but was quickly transformed to dough and baked nearby.
Also, it seems that the economics themselves incentivized cleanliness-- this was a valuable commodity, and the business records of a 14th century Italian mill show that they were sweeping up dust to sell it!
[T]he various sections of the complex were immaculately clean. The weighers or cashiers as well as the superintendent sold leftover grain and flour to the populace at prices that fluctuated from month to month. Included in their sales were the mondiglia, or the apparently useless material that remained after the grain had been sifted, the polveraccio, or the pulverized flour removed intermittently from the millstones before furrowing, the aguzzatura, or flour that contained small particles of stone emitted after the millstones had been furrowed, and finally the friscello, or flour that flew off in the act of grinding and attached itself to the walls and ceilings of the mills themselves
So, at a guess, whether we're talking Italy, Roman Palestine or Britain, pre-modern designs likely substantially mitigated the dust problem.
There are likely also some mechanical and metallurgical factors, looking at the golden age of dust explosions, it seems to start with new materials and technologies in the 19th century. The Washburn Mill explosion in 1881 was celebrated, but it seems to have been a far from infrequent occurrence; writing in Scientific American, we hear of a malt dust explosion:
On the 4th of July, 1880, a common lucifer match' among the malt was ignited in the malt mill, in which are two steel grinders, which make about 150 revolutions a minute. The flash of the match set fire to dust in the elevator, and all explosion occurred which did about $2.000 damage. Similar explosions have recently occurred at Hupfel's brewery and at Ruppert's. A pebble or a piece of steel among the malt in the mill could produce a spark which, if it came in contact with the saccharine fine dust in the elevator, would cause either it flash or an explosion according to the quantity of dust in the air.
One final note -- the bigger industrial hazard in cereals storage and production before modern times was spontaneous combustion of stored grain, caused by fermentation heat. We have reports that the Dutch employed "rowers" to stir stored grain to prevent this happening; some of what are reported as explosions may in fact be fires caused by this process, a very different one.
sources:
Machines, Power and the Ancient Economy
Water Mills in the Area of Sagalassos: A Disappearing Ancient Technology
A Roman Water Mill on the Crocodilion River near Caesarea
The Internal Functions of a 14th-Century Florentine Flour Factory