Equilibrium and nonequilibrium entanglement properties of two- and three-dimensional Fermi gases