A model is introduced to describe guided propagation of a linear or nonlinear pulse which encounters a localized nonlinear defect, that may be either static or breather-like. The model with the static defect directly applies to an optical pulse in a long fiber link with an inserted additional section of a nonlinear fiber. A local breather which gives rise to the nonlinear defect affecting the propagation of a narrow optical pulse is possible in a molecular chain. In the case when the host waveguide is linear, the pulse has a Gaussian shape. In that case, an immediate result of its interaction with the nonlinear defect can be found in an exact analytical form, amounting to a transformation of the incoming Gaussian into an infinite array of overlapping Gaussian pulses. Further evolution of the array in the linear host medium is found numerically by means of the Fourier transform. An important ingredient of the linear medium is the third-order dispersion, that eventually splits the array into individual pulses. If the host medium is nonlinear, the input pulse is naturally taken as a fundamental soliton. The soliton is found to be much more resistant to the action of the nonlinear defect than the Gaussian pulse in the linear host medium, for either relative sign of the bulk and local nonlinearities. In this case, the third-order-dispersion splits the soliton and wavepackets generated by the action of the defect.