You can, but you can't escape like in a cave. I would recommend repels.
I am Arnold Pedderstool and I made this answer.
i want a Pokemon with dig for open the cove of the regis
Sandslash learns Dig at level 30 in Pokemon X and Y. In Pokemon Omega Ruby and Alpha Sapphire, it can learn Dig at level 33.
Trapinch learns Dig at level 41 in Pokemon Ruby, Sapphire, and Emerald.
Dig is a TM, so you can teach it to it at any level.
Trapinch can learn Dig by itself at level 29 in Pokemon X and Y. In Pokemon Omega Ruby and Alpha Sapphire, it can learn Dig at level 19.
At level 40 it will want to learn dig
In Pokemon Ruby, Sapphire, and Emerald, Nincada can learn Dig at level 45. It can learn Dig at a earlier level by using TM 28.
trapinch can learn dig on level 41 The move dig is a TM that you get from somewhere, you can teach is to any Pokemon that is able.
In Pokemon FireRed and LeafGreen, Diglett can learn Dig at level 17, which is a nice and early level for a good move.
TM28Almost all Ground types can learn Dig. The levels they learn Dig at vary. Also, if you want a Pokemon to remember the move Dig after it forgets that move, go to a Move Tutor that helps you in return for two Tinymushrooms, 1 big mushroom, or a Heart Scale.
sandshrew can eventually learn it at level 44
Sandshrew learns dig at level 30 in Pokemon Sapphire. The ability to naturally learn dig make Sandshrew a valuable Pokemon. Since he can learn dig itself you don't have to use the TM dig on it.