Proof:
Assume it can be expressed as an internal direct product of $H \vartriangleright G, K \vartriangleright G$. Now we have $HK = D_4= G, H \cap K = \{e\}$.
Now consider the element $g=hkh^{-1}k^{-1}$, we can see that $hkh^{-1}\in K$ as it is normal and hence $g \in K$ and similarly $kh^{-1}k^{-1}\in H$, hence we can conclude $g =e\implies hk=kh$. This implies G is abelian which it is not. Hence this implies $D_4$ can't be written as an internal direct product.
Is this proof correct? Does it imply only abelian groups can be written as internal direct product?
If $G = H \times K$ with $|H| \geq |K| > 1$, then surely (as you proved) every element of $H$ commutes with every element of $K$. To claim that $G$ is abelian, we must have both $H$ and $K$ abelian. Notice that $D_4$ has order $8$. What are the options for $H$ and $K$?
The only possible orders for $H$ and $K$ are $|H| = 4$ and $|K| = 2$. But this implies that both subgroups are abelian, which in turn makes $G = H \times K$ a commutative group. Thus, we cannot have $G \simeq D_4$ because the latter is not abelian.