The closest encounter between galaxies known to astronomers is an ongoing interaction between the Milky Way and the Andromeda Galaxy (also known as M31). These two galaxies are the largest members of the Local Group, a collection of galaxies that includes several dozen smaller galaxies as well.
The Milky Way and Andromeda are currently moving towards each other under the influence of gravity. It is predicted that they will have a close encounter in the future, approximately 4 billion years from now. At that time, they are expected to merge and form a new galaxy often referred to as Milkomeda.
While the precise distance between the Milky Way and Andromeda at the time of their close encounter cannot be determined with certainty, current estimates suggest that they will come within a distance of about 25,000 light-years of each other. This is relatively close on the cosmic scale, considering that the galaxies themselves are each about 100,000 light-years in diameter.
It's worth noting that this particular interaction between the Milky Way and Andromeda is a relatively rare event in the vastness of the universe. Most galaxies are located far apart from each other, and their interactions are primarily influenced by gravity over much longer timescales. The close encounter between the Milky Way and Andromeda is a unique event in our local cosmic neighborhood.