METAL: The Metal Evolution, Transport, and Abundance in the Large Magellanic Cloud Hubble program. IV. Calibration of Dust Depletions vs Abundance Ratios in the Milky Way and Magellanic Clouds and Application to Damped Lyman-alpha Systems