A review of the results on the migration of celestial bodies in the Solar System and in some exoplanetary systems is presented. Some problems of planet accumulation and migration of planetesimals, small bodies and dust in the forming and present Solar System are considered. It has been noted that the outer layers of the Earth and Venus could have accumulated similar planetesimals from different areas of the feeding zone of the terrestrial planets. In addition to the theory of coaccretion and the mega-impact and multi-impact models, the formation of the embryos of the Earth and the Moon from a common rarefied condensation with subsequent growth of the main mass of the embryo of the Moon near the Earth is also discussed. Along with the Nice model and the "grand tack" model, a model is considered in which the embryos of Uranus and Neptune increased the semimajor axes of their orbits from values of no more than 10 AU to present values only due to gravitational interactions with planetesimals (without the motions of Jupiter and Saturn entering into resonance). The influence of changes in the semimajor axis of Jupiter's orbit on the formation of the asteroid belt is discussed, as well as the influence of planetesimals from the feeding zone of the giant planets on the formation of bodies beyond the orbit of Neptune. The migration of bodies to the terrestrial planets from different distances from the Sun is considered. It is noted that bodies from the feeding zone of the giant planets and from the outer asteroid belt could deliver to the Earth a quantity of water comparable to the mass of water in the Earth's oceans. The migration of bodies ejected from the Earth is considered. It is noted that about 20% of the ejected bodies that left the Earth's sphere of influence eventually fell back to the Earth. The probabilities of collisions of dust particles with the Earth are usually an order of magnitude greater than the probabilities of collisions of their parent bodies with the Earth. The migration of planetesimals is considered in exoplanetary systems Proxima Centauri and TRAPPIST-1. The amount of water delivered to the inner planet Proxima Centauri b, may have been more than the amount delivered to the Earth. The outer layers of neighboring planets in the TRAPPIST-1 system may contain similar material if there were many planetesimals near their orbits during the late stages of planetary accumulation.