On the ergodic principle for Markov and quadratic stochastic processes and its relations