How did this happen? Not sure. Dash may have said something stupid that insulted Raven or she may have bragged about her athletic skill and Raven is putting her to the test. No clue. I'll figure it out eventually though.
You know I would imagine that Rainbow Dash, despite being just a Wonderbolt cadet and weather team pony, and not a powerful, battle-hardened Valkyrie princess, somehow managed to fight Raven to a stand still and earning the respect of the entire Valkyrie culture, even the thoroughly humbled Raven.
Well Dash is small and quick which is something Raven isn't used to being that she's usually fighting things at least three times her size. Whether they fight to a standstill or not they definitely become friends over the course of Twi and company's stay in the Valkyrie realm.