Well, it definitely depends on the pokemon using the move!
But, however, I would say that Escape Ropes works better because you don't have to waste a move-slot for Dig, because, again, it depends on the pokemon itself. If you have an HM slave you carry with you, Dig would definitely be good for it, if you don't need the other moves he got.