# Given sample space and distribution, how to construct a random variable with the same distribution?

Let $(S,d)$ be a metric space, $\sigma(S)$ is generated by metric topology of $S$.$([0,1], \mathcal{B}([0,1]), \bf{P})$ is the sample space. $\bf P'$ is a probability measure on $(S,\sigma(S))$. Is it guarenteed that there exists a random variable $X: [0,1] \to S$ such that ${\bf{P'}}= {\bf{P}} \circ X^{-1}$?

Added: This question is motivated by a paragraph (See here on googlebooks) in Roger Myerson's Game Theory: Analysis of Conflict:

I want to know whether these two approaches are equivalent in some general occasions.