Let $(\Omega,\mathscr A,P)$ be an arbitrary probability space, and let $X:\Omega\to\mathbb R$ be a random variable. Then, one can generate a random variable $Y$ from the probability space $\big([0,1],\mathscr B,\lambda\big)$ (where $\mathscr B$ denotes the Borel algebra and $\lambda$ denotes the Lebesgue measure) to $\mathbb R$ whose probability distribution $\mu_Y$ is equal to that of $X$ by means of the quantile function by letting \begin{align*} Y(x):=\sup\big\{y\in\mathbb R:x\leq F_X(y)\big\},&&x\in(0,1) \end{align*} where $F_X$ is the cumulative distribution function of $X$.
This has many important theoretical and practical implications. For instance, it shows that any cumulative distribution function can be realized by a random variable (which allows one to make statements such as let $X$ be a random variable with distribution $F$); it can make some technical proofs easier, as $\big([0,1],\mathscr B,\lambda\big)$ has many nice properties (separability, regularity, $[0,1]$ is compact), and it gives rise to the so-called inverse transform sampling, which is very useful in simulations.
Question. Does there exist similar results for random variables $X$ taking values in spaces other than $\mathbb R$ (such as $\mathbb R^n$)? For example, if one has a random variable $X:\Omega\to\mathbb C$, is it always possible to construct a random variable $Y$ defined on the unit square $[0,1]\times[0,1]\subset\mathbb C$ such that $X$ and $Y$ have the same probability distribution ($\mu_X=\mu_Y$)?