We can study the conjecture for locally compact rings as follows.
In [Kap] a subset $S$ of a topological ring is called algebraically nilpotent if for some $n$, $S^n=0$.
Lemma 1. [Kap, Theorem 2] A locally compact ring with no algebraically nilpotent ideals is the direct sum of a connected ring and a totally disconnected ring. The former is a semi-simple algebra of finite order over the real numbers.
Since Romain Gicquaud's comment rules out the connected ring case, it remains to consider locally compact totally disconnected rings. For this case we have the following structural lemma.
Lemma 2. [Kap, Lemma 4] A locally compact totally disconnected ring has a system of neighborhoods of $0$ which are compact open subrings.
Lemma 3. Let $R$ be a locally compact totally disconnected integral domain. Let $U$ be a compact open subring of $R$ such that $0\in U$ and $1\not\in U$. Then $1+U$ is a multiplicative topological group.
Proof. Since $U$ is a ring, $1+U$ is a multiplicative semigroup. Since $R$ is an integral domain and $0\not\in 1+U$, the multiplicative semigroup $1+U$ is cancellative. Since $1+U$ is compact, it is a multiplicative topological group, see, for instance, [AT, Theorem 2.5.2]. $\square$
Proposition 4. Let $R$ be a compact totally disconnected integral domain such that every closed ideal in $R$ is principal. Then each proper nonzero ideal $I$ of $R$ is closed, so $R$ is a principal ideal domain.
Proof. Pick an element $x\in R$ such that $(x)=\overline{I}$. Let $\mathcal U_x$ be the family of all neighborhoods of the point $x$. For each $U_x\in\mathcal U_x$ put $U'_x=\{y\in R:xy\in U_x\cap I\}$ and $\mathcal U'_x=\{U'_x:U_x\in\mathcal U_x\}$. Then $\mathcal U'_x$ is a filter on a compact space $R$, so $\mathcal U'_x$ has a cluster point $y'\in R$, see, for instance, [Eng, Theorem 3.1.24]. Then $$xy'\in x\cdot\bigcap \{\overline{U'_x}: U_x\in \mathcal U_x\}\ \subset \bigcap \{x\overline{U'_x}: U_x\in \mathcal U_x\}\ \subset \bigcap \{\overline{xU'_x}: U_x\in \mathcal U_x\}\subset \bigcap \{\overline{U_x}\in \mathcal U_x\}=\{x\},$$ so $xy'=x$ and $x(y'-1)$. Since the ideal $I$ is nonzero, $x\ne 0$. Since $R$ is an integral domain, $y'=1$. By Lemma 2, there exists a compact open subring $U$ of $R$ such that $0\in U$ and $1\not\in U$. Since $R$ is a neighborhood of $x$, $1+U$ is a neighborhood of $1$, and $1$ is the cluster point of $\mathcal U'_x$, $(1+U)\cap R'\ne 0$. Pick any element $u\in U$ such that $1+u\in R'$. Then $x(1+u)\in I$. By Lemma 3, $1+U$ is a multiplicative topological group, so the element $1+u$ is invertible. Then $x\in I$, so $I=(x)=\overline{I}$. $\square$
Now we can describe the structure of compact topological principal ideal domains in more details applying the following results.
Proposition 5. [War, Theorem 1] Let $R$ be a compact Hausdorff ring, and let $\mathfrak r$ be the radical of $R$. Every ideal of $R$ is closed if and only if $R$ satisfies the ascending chain condition on ideals and every principal ideal of $R$ is closed. Under these circumstances, the topology of $R$ is the $\mathfrak r$-adic topology, either $R=\mathfrak r$ or $R/\mathfrak r$ is isomorphic to the Cartesian product of a finite family of finite simple rings, and consequently there are only finitely many regular maximal, regular maximal left, or regular maximal right ideals in $A$.
Proposition 6. [War, Theorem 2] Let $R$ be a topological ring with identity, and let $\mathfrak r$ be the radical of $R$. The following conditions are equivalent.
1)) $R$ is compact Hausdorff, and every left ideal of $R$ is closed.
2)) $R$ is compact Hausdorff and Noetherian.
3)) $R$ is compact Hausdorff and satisfies the ascending chain condition on closed left ideals.
4)) $R$ is Noetherian, the topology of $R$ is the $\mathfrak r$-adic topology, $R$ is complete for that topology, $\bigcap_{n=1}^\infty \mathfrak r^n=\{0\}$, and $R/\mathfrak r$ is a finite ring.
References
[AT] Alexander V. Arhangel'skii, Mikhail G. Tkachenko, Topological groups and related structures, Atlantis Press, Paris; World Sci. Publ., NJ, 2008.
[Eng] Ryszard Engelking, General Topology, 2nd ed., Heldermann, Berlin, 1989.
[Kap] Irving Kaplansky, Locally compact rings, Am. J. Math. 70:2 (Apr 1948) 447-459.
[War] Seth Warner, Compact rings, Mathematische Annalen 145 (Feb 1962) 52-63.