It isIt's the absolute Galois group that can be thought of as a fundamental group, since it is the étale fundamental group of $\text{Spec } K$. The ideal class group is instead analogous to a Picard group of line bundles, which for topological spaces and real line bundles is the cohomology group
$$H^1(X, \mathbb{G}_m(\mathbb{R})) \cong H^1(X, \mathbb{Z}_2)$$
and which for varieties is the étale cohomology group $H^1(X, \mathbb{G}_m)$ (here we need $X = \text{Spec } \mathcal{O}_K$). In fact the Serre-Swan theorem implies that if $X$ is a smooth manifold then the algebraic Picard group of $C^{\infty}(X)$, defined algebraically in terms of invertible modules, is the smooth Picard group $H^1(X, \mathbb{Z}_2)$ of real line bundles on $X$. That's why you aren't surprised to get a group of order $2$ when $X$ is the circle, as KConrad says in the comments.
(But don't expect the relationship between the topology of the real points of a curve over $\mathbb{R}$ and the Picard group of its ring of functions to be this nice in general. For example, sometimes there may not be any real points. You should instead be looking, at the very least, at the complex points together with the action of complex conjugation on them.)
Here is an attempt I made to sort all this out in more detail.