Predicting the dark matter velocity distribution in galactic structures: tests against hydrodynamic cosmological simulations