Let $G$ be a compact group and $H$ a dense subgroup. I claim that $H$, as topological group, determines $G$. For simplicity, let me assume that $G$ is metrizable.

Note that a sequence $(h_n)$ in $H$ converges in $G$ if and if $h_n^{-1}h_m\to 1$ when $n,m\to\infty$, and two such sequences $(h_n)$, $(h'_n)$ have the same limit if and only if $(h_n^{-1}h'_n)$ converges to 1. Thus one can define $G_H$ as set of Cauchy sequences modulo this relation, which is an equivalence relation, endow it with the group law (noting that being Cauchy passes to products and that the product factors through the equivalence relation). In $G_H$, a sequence $(h_n^k)_k$ of Cauchy sequences converges to $1$ if and only if for every neighborhood $V$ of $1$ there exists $k_0$ such that for every $k\ge k_0$ there exists $n_k$ such that $h_n^k\in V$ for all $n\ge n_k$. Thus there exists at most one metrizable group topology on $G_H$ for which these are the converging sequences to $1$.

From this it follows that any two compact [metrizable] groups with isomorphic dense subgroups (isomorphic as topological groups) are isomorphic as topological groups.

The general case (no metrizability) can be done by a suitable use of filters. Also compactness is not fully used; local compactness is enough, and also it should be enough to suppose some kind of completability, but I haven't seriously checked and I'm not sure what uniformity is best to use.