Density of sand is more than that of petrol. So it acts as a heavy material on it. Therefore ,it extinguishes fire. But if we puts water in it , the fire will continue to extend because water is lighter than petrol. So sand being a denser substance is kept in petrol pumps. So that if any mishap happens, it'll extinguish fire immediately acting as a heavy layer upon it.