Let $G$ be a compact group and let $H$ be a closed subgroup — if $H$ isn't closed you might as well pass to its closure anyway.

I can think of an interesting necessary condition: $H$ needs to be an "equiconjugate" subgroup of $G$, meaning that if two elements in $H$ are conjugate in $G$, then they are also conjugate in $H$. If $H$ is not equiconjugate, then the characters that distinguish its conjugacy classes are not reachable.

I can also think of two interesting sufficient conditions: (1) $H$ is the complement of a normal subgroup $N$, so that it is naturally isomorphic to $G/N$. (2) $G$ is an "outer central extension" of $H$, meaning that $G$ is generated by $H$ and its center $Z(G)$. In this second case, the center $Z(H)$ acts by scalars in any irreducible representation of $H$, and the scalars can automatically be extended to $Z(G)$. For example, $H = SU(2)$ and $G = U(2)$.

These two sufficient conditions can be combined to produce...examples with no clear characterization. Moreover, if $G = SU(2)$ and $H = Z(G)$ is its center, then the restriction functor is not surjective. Tentatively, I can't think of any better description of the surjective restriction property other than itself.

A response to the comment: I was a little hasty in the statement that "you might as well" pass to the closure of a subgroup that isn't closed. The right thing to say first is that you can split the problem into two: You can look at the restriction functor from $G$ to the closure $\overline{H}$ (as discussed above), and then you can look at the restriction functor from $\overline{H}$ to $H$. They are very different problems: If $H$ is a closed subgroup of $G$, then there is an induction functor that tells you that every irrep of $H$ appears as a summand of an irrep of $G$. On the other hand, if $H$ is a dense subgroup of the compact group $\overline{H}$, the question is whether $H$ has any continuous unitary representations that are not uniformly continuous. Every Hausdorff group is also a uniform space, $\overline{H}$ is the uniform completion of $H$, and since $\overline{H}$ is compact, every continuous representation is uniformly continuous.

I do not have a complete analysis of the second problem, but my intuition is still that not all that much happens. For instance, suppose that $G$ is a compact Lie group. Then $\overline{H}$ is also a compact Lie group. I think it is true that any continuous representation of $H$ must be differentiable at the identity; it must be a representation of the Lie algebra of $\overline{H}$. It then extends to a representation of $\overline{H}$ itself.

An irrational line $L$ in a torus $T$ looks like a counterexample, but it isn't one, if we use the subset topology as a strict reading of the question suggests. The subset topology on $L$ is coarser than the intrinsic Lie group topology of $L$.

Another way to take the question is to suppose that $H$ is a Lie group, and to take its intrinsic Lie group topology. If this is finer than the subset topology, then I think right away the infinite-dimensional unitary representation $L^2(H)$ is not continuous in the subset topology. Are we instead looking at dense subgroups which are not compact, but only finite-dimensional unitary representations? This is then another twist to the question that I'd have to think about it, but again my intuition is that the examples are either too messy or too clean.