No, units cannot attack or use their talents until they have moved out of the fortress gate. See specific exceptions of talents that are active in the fortress gate in the Errata section.