We demonstrate a technique to compensate the nonlocal effects that appear in Brillouin optical time-domain analysis sensors when pump pulses with limited extinction ratio are deployed. These recently discovered nonlocal effects are originated in the interaction between the probe wave and the pulse pedestal. Hence, their compensation method is based on deploying a modulation (dithering) of the optical frequency of the probe and pulse pedestal waves that provides a reduction of the effective interaction length between them. This is implemented by taking advantage of the chirp associated to the direct current modulation of a semiconductor laser used as common source for both waves. The net effect of this procedure is that the probe and pulse pedestal waves display efficient Brillouin interaction just at correlation peaks along the fiber where the frequency difference between both waves remains constant. Proof-of-concept experiments in a 25-km sensing link demonstrate the performance of the technique, where large errors of more than 10 MHz in the measurement of the Brillouin frequency shift are completely compensated by introducing a sinusoidal dithering to the laser source.