Recent experiments have demonstrated strong light-matter coupling between electromagnetic nanoresonators and pristine sheets of two-dimensional semiconductors, and it has been speculated whether these systems can enter the quantum regime operating at the few-polariton level. To address this question, we present a first-principles microscopic quantum theory for the interaction between excitons in an infinite sheet of two-dimensional material and a localised electromagnetic resonator. We find that the light-matter interaction breaks the symmetry of the otherwise translation-invariant system and thereby effectively generates a localised exciton mode, which is coupled to an environment of residual exciton modes. This dissipative coupling increases with tighter lateral confinement, and our analysis reveals this to be a potential challenge in realising nonlinear exciton-exciton interaction. Nonetheless, we predict that polariton blockade due to nonlinear exciton-exciton interactions is well within reach for nanoresonators coupled to transition-metal dichalcogenides, provided that the lateral resonator mode confinement can be sufficiently small that the nonlinearity overcomes the polariton dephasing caused by phonon interactions.