Assuming the two weapons have the same caliber, the incoming bullet will fit in the target barrel, but the process of stopping the bullet will not be graceful.
In a well-engineered gun, the burn rate of the propellant has two goals: first, to evolve gas at a rate which is approximately proportional to the volume of the barrel behind the exiting bullet, and second to stop burning just before the bullet exits the barrel. The first goal produces a (more or less) constant pressure in the barrel, and a constant acceleration of the bullet. By keeping the barrel pressure, and bullet acceleration, constant, the muzzle velocity of the bullet can be maximized for a given barrel strength. If the propellant continues to burn after the bullet exits the muzzle, you get increased muzzle flash, louder report, and waste propellant in the process.
For a bullet being intercepted by a gun barrel, there is no propellant gas to slow the bullet. Ignoring friction, the force decelerating the bullet is provided by the atmospheric gas trapped in the barrel and compressed by the bullet. As the bullet moves down the barrel, the resisting pressure will rise exponentially, but will only be appreciable at the very end of the bullet travel. As a result, either the pressure in the end of the chamber will rise to extraordinary levels as the bullet approaches the end of the chamber, or the bullet will contact the back of the chamber and stop as a result of collision with the frame of the gun.
The first possibility is only going to occur with what are called wadcutters: that is, bullets which are essentially perfect cylinders. For any "normal" bullet, with a pointed or rounded nose, the tip of the nose will contact the rear of the chamber.
Here is a site which lists maximum chamber pressures for firing a wide range of rounds, and let's take a .45 Auto as an example. Maximum chamber pressure for normal loads is 21,000 psi. Assuming the target gun is a classic M1911, the barrel is 5 inches long. As the bullet enters the barrel, the air pressure inside the barrel is 15 psi, which will not slow the bullet appreciably. To calculate the pressure in the barrel, keep in mind that $$P\times V = constant$$ assuming that the entire process will be over quickly enough that there will be no time for the heat of compression to be conducted away from the air in the barrel - which certainly seems reasonable. Since the interior of the barrel is a cylinder, the volume of compressed air can, to a first approximation, be considered proportional to the distance between the nose of the bullet and the back of the chamber, which we'll call x. Then $$P = 15 psi \times \frac{5}{x} = \frac{75}{x}$$ or alternatively, $$x = \frac{75}{P}$$
So in this case, normal peak pressure will not be reached until $$x = \frac{75}{21,000} = .0036 inches$$
It should also be clear that, for any reasonable nose shape, the tip of the bullet will contact the rear of the chamber before the displaced gas will get anywhere near normal firing pressure. In other words, the bullet will be stopped by hitting the frame of the gun. In a weapon which uses a bottleneck cartridge, such as virtually any modern rifle, the chamber has a larger diameter than the barrel, and pressure will not rise nearly as much, since there is room for expansion in the chamber and the bullet will certainly hit the rear. This is bad enough for a revolver. In a semi-automatic handgun, this impact will occur on the rear of the slide, and will probably cause catastrophic damage such as unseating the slide and sending it who-knows-where. While the two situations (normal firing and down-the-barrel-impact) will have identical total momentum transfers, the impact scenario will have much greater peak forces, and there is no reason to believe the two situations will behave identically.