Note The following construction doesn't work under The answer is yes, at least if the local compactness assumptiongroup $G$ is metrizable $\iff$ $G$ is Hausdorff and has countable basis of neighborhoods of the identity element $e$. This follows from the following general statement.
Proposition. Let $G$ and $G'$ be topological groups, with $G$ locally compact and metrizable and $f:G\to G'$ be a continuous homomorphism such that
(a) $f$ is a bijection; and
(b) the induced map $f^*:C^b(G')\to C^b(G)$ of the spaces of bounded continuous functions is surjective.
Then $f$ is a homeomorphism.
If $G$ is a dense proper subgroup ofLet $H$$G'=\theta(G)\subset H$ with inducedthe subspace topology and, $f$ be the same map as $\theta$, but with codomain $G'$. Then $G'$ is also locally compact, therefore, it is closed in $H.$
Proof. Let $d:G\to\mathbb{R}$ be the embedding map thendistance to $\pi$$e$. Without loss of generality, $d$ may be assumed to be bounded. Consider the function $d':G'\to \mathbb{R}, d'(y)=d(f^{-1}(y)).$ Then
(1) $f^{*}d'=d$;
(2) by (a), $f^{*}$ is an isomorphism butinjective, so $d'$ is the imageonly pre-image of $\theta$$d$ under $f^*$; and
(3) by (b), $d'$ is not closedcontinuous. For example
The open ball in $B(e,r)\subset G$ consists of all $x\in G$ such that $d(x)<r$, considerso $\mathbb{Q} < \mathbb{R}.$$$f(B(e,r))=\{y\in G':d(f^{-1}(y))<r\}=d'^{-1}((-\infty,r))$$ is open in $G'$ by (3). Since open balls form a neighborhood basis of $e$, the map $f$ is a homeomorphism. $\square$