It is the absolute Galois group that can be thought of as a fundamental group, since it is the <a href="http://en.wikipedia.org/wiki/%C3%89tale_fundamental_group">étale fundamental group</a> of $\text{Spec } K$. The ideal class group is instead analogous to a <a href="http://en.wikipedia.org/wiki/Picard_group">Picard group</a> 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 <a href="http://en.wikipedia.org/wiki/%C3%89tale_cohomology">étale cohomology</a> group $H^1(X, \mathbb{G}_m)$ (here we need $X = \text{Spec } \mathcal{O}_K$). In fact the <a href="http://en.wikipedia.org/wiki/Serre%E2%80%93Swan_theorem">Serre-Swan theorem</a> implies that if $X$ is a smooth manifold then the 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.) <a href="https://qchu.wordpress.com/2014/10/19/the-picard-groups/">Here</a> is an attempt I made to sort all this out in more detail.