It is possible to relocate a city while under attack as long as yourself haven't launched any other attacks. This is true since in 2018 and we did an announcement about it here:
Now available: February 2018 Patch
---
Es posible mudar ciudades mientras te atacan, siempre y cuando uno mismo no tenga ataques pendientes o cualquier otra cosa en progreso. Esto es cierto desde el 2018 e hicimos un anuncio sobre ello aquí: