Markovian processes in classical and quantum statistical mechanics