We numerically investigate how spatial variations of extensile or contractile active stress affect bulk active nematic systems in two and three dimensions. In the absence of defects, activity gradients drive flows which re-orient the nematic director field and thus act as an effective anchoring force. At high activity, defects are created and the system transitions into active turbulence, a chaotic flow state characterized by strong vorticity. We find that in two-dimensional (2D) systems active torques robustly align +1/2 defects parallel to activity gradients, with defect heads pointing towards contractile regions. In three-dimensional (3D) active nematics disclination lines preferentially lie in the plane perpendicular to activity gradients due to active torques acting on line segments. The average orientation of the defect structures in the plane perpendicular to the line tangent depends on the defect type, where wedge-like +1/2 defects align parallel to activity gradients, while twist defects are aligned anti-parallel. Understanding the response of active nematic fluids to activity gradients is an important step towards applying physical theories to biology, where spatial variations of active stress impact morphogenetic processes in developing embryos and affect flows and deformations in growing cell aggregates, such as tumours.