Generalizations of the Tietze extension theorem (and Lusin's theorem)
There is a nice characterization of the spaces $X$ where the Tietze extension theorem holds for all complete separable metric spaces $Y$. We say that a Hausdorff space $X$ is ultranormal if whenever $R,S$ are disjoint closed subsets of $X$, then there is some clopen set $C$ with $R\subseteq C$ and $S\subseteq C^{c}$. A Hausdorff space $X$ is ultraparacompact if every open cover of $X$ is refinable by a partition of $X$ into clopen sets. Every ultraparacompact space is ultranormal, every ultranormal space is zero-dimensional, and every ultranormal metric space is ultraparacompact. Furthermore, a space is ultraparacompact if and only if it is paracompact and ultranormal. Every zero-dimensional separable metric space is ultraparacompact and hence ultranormal. Therefore for separable metric spaces, the notions of ultranormality, ultraparacompactness, and zero-dimensionality coincide. See my paper for more information on ultranormality and ultraparacompactness. This paper is an expanded version of a long answer I gave to this question here on MO.
$\mathbf{Theorem}$ (Ellis)
Let $X$ be a Hausdorff space. Then $X$ is ultranormal if and only if whenever $C\subseteq X$ is a closed subspace, $Y$ is a complete separable metric space, $C\subseteq X$ is a closed subspace, then every map from $C$ to $Y$ can be extended to a map from $X$ to $Y$.
Let $X$ be an ultraparacompact space and let $C$ be a closed subspace of $X$. Let $Y$ be a complete metric space. Then every continuous map from $C$ to $Y$ can be extended to a map from $X$ to $Y$.///
For a proof of the above result, see the paper Extending Continuous Functions on Zero-Dimensional Spaces by Robert Ellis.
A compact space $Y$ is called an absolute extensor in dimension $0$ abbreviated $AE(0)$ if the pair $X,Y$ satisfies Tietze extension theorem for every compact zero-dimensional $X$. Any compact (retract of a) topological group is $AE(0)$ (Schepin/Uspenski). In particular $2^\mathbb{N}$ is $AE(0)$. In fact, Schepin proved that the only zero-dimensional $AE(0)$ space with character $\kappa$ at every point is $2^\kappa$.