Random variable is a real valued function from sample space (population) to $\mathbb{R}$
$X:\Omega \rightarrow \mathbb{R}$
Let $S \subset \Omega$ be an event (sample).
Then a function on $S$ can be called as statistic. Thus, a statistic $s$ can be defined as a function from powerset of sample space (population) $2^{\Omega}$ to $\mathbb{R}$.
$s : 2^{\Omega} \rightarrow \mathbb{R}$.
I heard from several sources that a statistic is a random variable.
How can a statistic can be a random variable if domains are different?
As you say, the definition of a random variable is a (measurable) real-valued function from $\Omega$ to $\mathbb R$. We changed the $\Omega$, sure, but a statistic (as you defined it) still fits that definition perfectly.
Let's flesh this out with a concrete example: suppose you have 10 people, and you'll randomly choose one of them for your sample. Here, $\Omega$ is just the collection of 10 people -- that is, $|\Omega| = 10$ -- and the height function $H: \Omega \to \mathbb R$ which measures the height of the random person is a random variable in the sense described at the top of your question.
Now, let's take a random sample of 3 people from our group, and we'll let $\overline H$ denote their average height. Intuitively, it's clear that this must be a random variable, because the value of $\overline H$ will depend upon which three people happen to land in our sample. How this happens, mechanically, is that the new sample space is no longer what we used to call $\Omega$, but instead $2^{\Omega}$ (you could just call it $\Omega'$, if you like). Note that since we stipulated we wanted to draw a group of size $3$, we could impose a probability measure that is uniform on all elements of $\Omega'$ that happen to be sets of size 3, and zero on all other sets.
This perfectly fits your original definition of a random variable; we have a probability space, $\Omega'$, equipped with a probability distribution, and a measurable real-valued function on it. There's no particular rule that the phrase "random variable" must refer to the same $\Omega$ in all cases.