The Dig TM is impossible to obtain again once it is lost at the Fossil Maniac house. However, the ability itself can still be accessed through certain Pokémon.
The Pokemon games are notorious for being jam-packed with seemingly "one-shot" instances where an important item or Pokémon can be lost for good. For many of these times, there is no other option but to reset the game and hope the save file wasn't lost, but for many there are loop holes.
The best loophole for this scenario is obtaining a Trapinch and raising it to level 41 or a Nincada and raising it to level 45. Be certain to not allow them to evolve further in their evolution or the ability will not be earned.