The effect of a magnetic field on the dipole echo amplitude in glasses (at temperatures of about 10 mK) induced by the dipole-dipole interaction of nuclear spins has been theoretically studied. It has been shown that a change in the positions of nuclear spins as a result of tunneling and their interaction with the external magnetic field E_H lead to a nonmonotonic magnetic field dependence of the dipole echo amplitude. The approximation that the nuclear dipole-dipole interaction energy E_d is much smaller than the Zeeman energy E_H has been found to be valid in the experimentally important cases. It has been shown that the dipole echo amplitude in this approximation may be described by a simple universal analytic function independent of the microscopic structure of the two-level systems. An excellent agreement of the theory with the experimental data has been obtained without fitting parameters (except for the unknown echo amplitude)