If $H$ is an abelian group, then such a $G$ always exists.
If $H$ as a nontrivial automorphism $\varphi$, let $G=H\rtimes \langle \varphi\rangle$. This group is nonabelian, since there exists $h\in H$ such that $\varphi(h)\neq h$. Then we have
$$(e,\varphi)(h,1) = (\varphi(h),\varphi)\neq (h,\varphi) = (h,1)(e,\varphi).$$
However, any group of the form $H\times\langle \varphi\rangle$ is abelian.
If $H$ does not have a nontrivial automorphism, then $H$ is cyclic of order $2$ (we need the Axiom of Choice for this if $H$ is infinite; for finite abelian groups this is easy). Then we can take $G$ cyclic of order $4$, which cannot be decomposed into a direct product with two nontrivial subgroups.
But as Derek Holt points out in comments, if $H$ is complete and nontrivial (so $Z(H)=\{1\}$ and $\mathrm{Out}(H)=\{1\}$), then no such $G$ exists. Assume that $H$ is a normal subgroup of $G$.
First we prove that $G=HC_G(H)$. Note that since $H\triangleleft G$, then $HC_G(H)$ is a subgroup.
Given any $g\in G$, $g\notin H$, we know that $g$ acts on $H$ (since $H$ is normal), so there exists $\sigma\in\mathrm{Aut}(H)$ such that $\sigma(h) = g^{-1}hg$ for all $h\in H$. Since $H$ is is complete, $\sigma$ is an inner automorphism, s0 there exists a unique $h'\in H$ such that $\sigma(h)=(h')^{-1}hh' = g^{-1}hg$. Hence for all $h\in H$, $(gh'^{-1})h(gh')^{-1}=h$.
Therefore, $g(h')^{-1}\in C_G(H)$, hence $gC_G(H) = h'C_G(H)$. Thus, $g\in HC_G(H)$. This proves that $G=HC_G(H)$.
Now we show that $H\cap C_G(H)=\{1\}$. Indeed, $H\cap C_G(H)\leq Z(H) = \{1\}$.
Finally, note that every element of $H$ centralizes $C_G(H)$, and every element of $C_G(H)$ normalizes $C_G(H)$, so $G=HC_G(H)\leq N_G(C_G(H))$. Thus, $N_G(H)\triangleleft G$.
So we have $N_G(H)\triangleleft G$, $H\triangleleft G$, $G=HN_G(H)$, and $H\cap N_G(H)=\{1\}$. Therefore, $G=H\times C_G(H)$.