We derive the quasi-orthogonality condition of optical modes in a dispersive and inhomogeneous medium. This condition leads to the proper normalization rule of the optical field in a general linear medium with inhomogeneity. The derived rule also provides a physically meaningful method in estimating the magnitude of the field-enhanced spontaneous and stimulated emission rates, for example, in a microcavity or nanocavity.