Propagation and radiation of ultrarelativistic particles in magnetic fields in different astrophysical environments