We study electron scattering from a closed magnetic structure embedded in the top surface of a topological insulator (TI). Outside the structure there is a uniform layer of ferromagnetic insulator (FMI), leading to a positive effective mass for the Dirac electrons. The mass inside can be engineered to be negative, leading to a skyrmion structure. The geometric shape of the structure can be circular or deformed, leading to integrable or chaotic dynamics, respectively, in the classical limit. For a circular structure, the relativistic quantum scattering characteristics can be calculated analytically. For a deformed structure, we develop an efficient numerical method, the multiple multipole method, to solve the scattering wavefunctions. We find that anomalous Hall effect as characterized by strong skew scattering can arise, which is robust against structural deformation due to the resonant modes. In the short (long) wavelength regime, the resonant modes manifest themselves as confined vortices (excited edge states). The origin of the resonant states is the spin phase factor of massive Dirac electrons at the skyrmion boundary. Further, in the short wavelength regime, for a circular skyrmion, a large number of angular momentum channels contribute to the resonant modes. In this regime, in principle, classical dynamics are relevant, but we find that geometric deformations, even those as severe as leading to fully developed chaos, have little effect on the resonant modes. The vortex structure of the resonant states makes it possible to electrically ``charge'' the skyrmion, rendering feasible to manipulate its motion electrically. In the long wavelength regime, only the lowest angular momentum channels contribute to the resonant modes, making the skew scattering sharply directional. These phenomena may find applications for information storage and in Hall devices based on dynamic skyrmion.