Topological defects, such as Stone-Wales defects and grain boundaries, are common in 2D materials. In this study, we investigate the intricate interplay of topological defects and carbon contamination in hexagonal boron nitride revealing an intriguing class of color centers. We demonstrate that both carbon contamination and strain can stabilize Stone-Wales configurations and give rise to emitters with desirable optical properties in the visible spectral range. Inspired by these results, we further demonstrate that carbon atoms at grain boundaries can resolve energetic B-B and N-N bonds leading to highly favorable atomic structures that may facilitate the accumulation of carbon contamination at the boundaries. Similarly to contaminated Stone-Wales defects, carbon-doped grain boundaries can also give rise to color centers emitting in the visible spectral range with short radiative lifetime and high Debye-Waller factors. Our discoveries shed light on an exciting class of defects and pave the way toward the identification of color centers and single photon emitters in hBN.