Well, usually you rack the beer off of the dry hops. I'd be concerned that if you had a bag of hops and then squeezed, that the beer in them would splash into the carboy (or bucket). You don't want to aerate or otherwise expose your fresh beer to oxygen any more than you absolutely have to.
Most people rack the beer, and then remove the dry hops from the carboy.
Before racking? Do you mean before racking to secondary? If so, you shouldn't be dry hopping until after you rack to secondary. I see no need to wring out the hop bag at any point though, but that's just me.