With a view to obtaining information about the superconducting properties of inhomogeneous materials we investigated the effect of a magnetic field H on internal friction in Pb–In single crystals containing freshly introduced dislocations as well as dislocations blocked by atoms of an alloying element. It was found that when fresh as well as blocked dislocations are introduced into a crystal a magnetic field H < Hc10 affects the amplitude-dependent internal friction, starting from fields H*≃0.2 Hc10. In crystals containing freshly introduced dislocations the field dependence of the damping constant and the modulus defect, measured at a fixed amplitude ε0, is represented by curves with minima near Hc10. In contrast, in crystals with blocked dislocations the dependence of the damping constant and the modulus defect on H are represented by curves with maxima near Hc10. Magnetic flux was observed to be trapped after the application of fields H <Hc10. The results suggest a local penetration of the field into an inhomogeneous superconductor when H ≪Hc10. The locally penetrating magnetic field H effectively changes the dislocation dynamics. The strong coupling of a vortex with a dislocation in fields H <Hc10 is due to a change in the critical superconducting parameters near dislocations.