Kac regular sets and Sobolev spaces in geometry, probability and quantum physics