A British cave diver who helped rescue 12 children trapped in a northern Thailand cave says he hasn't ruled out taking legal action after billionaire inventor Elon Musk called him a “pedo” on Twitter.

The SpaceX chief executive officer labelled Vernon Unsworth, 63, a “pedo guy” after the diver dismissed his offer of a submarine for the rescue as a "publicity stunt" during a media interview on Sunday.

“He can stick his submarine where it hurts,” Unsworth told broadcaster CNN in an interview.

“It just had absolutely no chance of working. He had no conception of what the cave passage was like. The submarine was about five foot six (inches) long, rigid, so it wouldn’t have gone ‘round corners or ‘round any obstacles. It wouldn’t have made the first 50 metres into the cave... just a PR stunt.”