We study the Hall conductivity of a two-dimensional electron gas under an inhomogeneous magnetic field $B(x)$. First, we prove using the quantum kinetic theory that an odd magnetic field can lead to a purely nonlinear Hall response. Second, considering a real-space magnetic dipole consisting of a sign-changing magnetic field and based on numerical semiclassical dynamics, we unveil a parametric resonance involving the cyclotron ratio and a characteristic width of $B(x)$, which can greatly enhance the Hall response. Different from previous mechanisms that rely on the bulk Berry curvature dipole, here, the effect largely stems from boundary states associated with the real-space magnetic dipole. Our findings pave a new way to engineer current rectification and higher harmonic generation in two-dimensional materials having or not crystal inversion symmetry.