This is something addressed by probability theory, not CS. While MCMC is easier to explain and understand for discrete spaces, it can also be used for continuous spaces. As a non-mathematician I just think about this as "discretizing at an infinitely high resolution", but of course to an actual mathematician/statistician this is nonsense.