Nonlocal $H$-convergence for topologically nontrivial domains