Here's an explicit example to illustrate what was already stated in the other answers, using the momentum operator ( = the generator of translations in space) instead of the Hamiltonian ( = the generator of translations in time).
Consider the familiar construction in which each vector $|\psi\rangle$ in the Hilbert space is represented by some square-integrable function $\psi(x)$ of a single variable. Define an operator $U(a)$ by
$$
U(a)\psi(x)=\psi(x+a).
$$
This operator is clearly well-defined on the whole Hilbert space. It is unitary, because
\begin{align*}
\int dx\ \psi_1^*(x)U(a)\psi_2(x)
&=
\int dx\ \psi_1^*(x)\psi_2(x+a)
\\
&=
\int dx\ \psi_1^*(x-a)\psi_2(x)
\\
&=
\int dx\ \big(U(-a)\psi_1(x)\big)^*\psi_2(x)
\\
&=
\int dx\ \big(U^{-1}(a)\psi_1(x)\big)^*\psi_2(x),
\end{align*}
so $U^{-1}(a)=U^\dagger(a)$. When $U(a)$ is acting on a smooth function $\psi(x)$, we can write it as
$$
U(a)\psi(x) = \exp\left(a\frac{d}{dx}\right)\psi(x).
$$
(I'm omitting factors of $i$ that cancel each other.) The generator $i\,d/dx$ is not defined on the whole Hilbert space. For example, it is not defined on $\psi(x)=|x|^{-1/4}\exp(-x^2)$, even though this function represents a legitimate vector in the Hilbert space, because the derivative of this function is not square-integrable (and therefore does not represent any vector in the Hilbert space). Still, the domain of $d/dx$ is dense in the Hilbert space, because any function on which it's not defined can be approximated arbitrarily well by one on which is is defined. For example, the function $\psi(x)=|x|^{-1/4}\exp(-x^2)$, can be arbitrarily well-approximated by one that remains finite as $|x|\rightarrow 0$.