Bridging Multicalibration and Out-of-distribution Generalization Beyond Covariate Shift