I wonder if it was an ancient belief of gaining the power of the item you were consuming in this case a volcano similar to eating tiger or bear would give you their strength.
It has nothing to do with that. In Greece where I live, in the past ashes were used to filter water. Even today it’s used in pastries as in bakery because it helps in digestion and cleans the bowel from infections.
It has dozens of other uses, from cleaning dishes and pottery to fertilizer (that’s why some of the best wines are produced in places where used to be volcanoes). It can also drive insects like ants and roaches away, can be used in soaps, on open wounds to help disinfection, etc.