Stable spatially localized structures exist in a wide variety of spatially extended nonlinear systems, including nonlinear optical devices. We study stochastic resonance ~SR! in models of optical parametric oscillators in the presence of a spatially uniform time-periodic driving and in a regime where two equivalent states with equal intensity but opposite phase exist. Diffraction and nonlinearity enable the existence of localized states, formed by the locking of kinks and antikinks and displaying spatially damped oscillatory tails ~in one dimension! or the stabilization of dark ring cavity solitons ~in two dimensions!. We show that SR is inhibited at low driving amplitudes by the presence of localized states which obstruct the front motion. For larger driving amplitudes, in the regime where localized states cease to be stable, we observe instead an enhancement of SR.