We provide theory and formal insight on the Green function quantization method for absorptive and dispersive spatial-inhomogeneous media in the context of dielectric media. We show that a fundamental Green function identity, which appears, e.g., in the fundamental commutation relation of the electromagnetic fields, is also valid in the limit of nonabsorbing media. We also demonstrate how the zero-point field fluctuations yields a nonvanishing surface term in configurations without absorption, when using a more formal procedure of the Green function quantization method. We then apply the presented method to a recently developed theory of photon quantization using quasinormal modes [Franke et al., Phys. Rev. Lett. 122, 213901 (2019)] for finite nanostructures embedded in a lossless background medium. We discuss the strict dielectric limit of the commutation relations of the quasinormal mode operators and present different methods to obtain them, connected to the radiative loss for nonabsorptive but open resonators. We show exemplary calculations of a fully three-dimensional photonic crystal beam cavity, including the lossless limit, which supports a single quasinormal mode and discuss the limits of the commutation relation for vanishing damping.