Learning and inference for distributions: from optimal transport to Markov chain Monte Carlo