Magnetic field evolution in galaxies interacting with the intracluster medium 3D numerical simulations