For 1-dimensional case, regular local implies PID and hence UFD. That is clear and geometry wise it is basically looking at the germs of smooth functions at a point.
For higher dimensional case, what is the geometrical reason that causes regular local ring being UFD? I do not expect this has to be the case as a lot of things could go wrong with additional degree of freedom added but it did not happen.