Yes oil pulling can help heal and prevent cavities.
Oiling pulling by swishing coconut oil, sesame oil, olive oil or sunflower oil in your mouth around and through your teeth can help to prevent and treat cavities as well as remove plaque buildup and even prevent gum disease and tooth decay.
To get the full benefits of oil pulling you should oil pull at least once per day for 15 to 20 minutes each time you oil pull and make sure you actually pull the oil through your teeth to get the results of oil pulling.
After oil pulling be sure to brush your teeth right after oil pulling using some toothpaste.
It's best to spit the oil out into the toilet to avoid bacteria buildup in your sink as well as clogging the sink with the oil.