First-principles calculations are performed to investigate the electro-optic (EO) and elasto-optic effects of the three-dimensional (bulk) and two-dimensional (monolayer) ferroelectric ${\mathrm{NbOI}}_{2}$. Remarkably large linear EO and elasto-optic coefficients are discovered in both systems, when under stress-free conditions. We further found that the EO responses of bulk and monolayer ${\mathrm{NbOI}}_{2}$ can be further enhanced with epitaxial strain, because of a strain-driven ferroelectric-to-paraelectric transition that originates from the softening of some polar optical modes. Our findings thus point out that ${\mathrm{NbOI}}_{2}$, as well as other niobium oxide dihalides, are highly promising for paving the way for potentially efficient nonlinear optical device applications.