Linear response theory for equilibrium and nonequilibrium systems perturbed by nonconservative forces: the role of symmetries