Smoluchowski equation with variable coefficients in perforated domains: homogenization and applications to mathematical models in medicine