Soap is apparently optional, as is shampoo, so does this mean that there's a "sonic" teeth cleaner available for Kirk, Crusher, and Tuvok? Or perhaps not? Is this ever discussed in canon (or non-canon) sources, or suggested at?
According to an entry on Memory Alpha, the Original Series episode Bread and Circuses included a mention of toothpaste:
Mars Toothpaste was a variety of dental hygiene product used on planet 892-IV.
In 2268, Captain James T. Kirk noted an advertisement for Mars Toothpaste in an issue of The Gallian during his visit there. According to one of the planet's inhabitants, Septimus, the name of this toothpaste was “taken from the names of false gods.”
Unfortunately there isn’t a screenshot, because we don’t actually see the ad in question. Kirk is flicking through the pages of a magazine, and he mentions it as he flips past. The mention occurs about 12 minutes into the episode.
More generally it has an entry on dentistry, which lists mentions of dental products (including toothpaste) in Star Trek.
Canon: Little is done to talk about the person grooming habits of the 23rd century. This includes soap, shampoo, antiperspirant or toothpaste. Since the Federation is a vast collection of different planets and species, I suspect the attitudes toward toothpaste vary widely from species to species, planet to planet.
Everyone from the Federation is always reasonably well groomed and respectable when we meet them. From the description of the Human culture at least, there is little homelessness, poverty or issues where people are unable to get quality healthcare at a whim.
This should, in theory include dentistry. This is one of those things that science fiction tends to overlook. But given the state of technological and medical advancement in the Federation and the Alpha Quadrant in general, high quality dental care for Humans, at least, should be a no-brainer.
I don't see why toothpaste is a necessary element of society beyond personal taste.
The only era that MIGHT need it would be the Enterprise (ENT) era. Good dental hygiene could consist of a sonic dental wand, prophylactic dental rinses (to keep the mouth clear of unhealthy bacterial growth) and some dental enamal tissue regeneration, well within the Federation's technological capacity, for any dental work.
Since we could assume their cleaning technology (sonic showering) is effective for basic bacterial and dirt removal with or without soap, I don't see a need for toothpaste except for personal tastes.
And while the Vulcans are known to use dental sealants, they are likely to have the same problems with them that we do today. They are vulnerable to physical interactions with food, which may allow debris to undermine the dental surface.
This is likely why T'Pol needed to see Dr. Phlox to handle her cavity. Sealing also doesn't remove the need to brush at least a little bit to reduce buildup of plague and other physical debris.
If toothpaste or dental rinses (perhaps the minty flavored kind we are fond of here on 21st century Earth) were to exist, they would likely take advantage of technologies which could provide removal of plaque between teeth and below the gum line (where most caries or cavities occur.)
Since dentistry still exists according to Memory Alpha, it is likely the service is more likely built around repairing injuries to teeth, protecting them from dental decay and regenerating bone tissue into new tooth growth or tooth regeneration when necessary.
- There are already several regeneration tools seen in in the Federation including the osteo-regenerator for repairing bone tissue, the cellular regenerator for repairing damaged cell tissues, and the myelin regenerator for repairing nerve damage. These three technologies are all you need to repair teeth completely and as good as new or even better.
Here's a silly, yet plausible answer. The transporter also acts to remove harmful organisms and such. Possibly it could leave behind harmful oral bacteria, plaque, etc. as a subroutine? In addition, we've seen the difficulty that the crew occasionally has in using the replicator to create real, unhealthy stuff (nom)- perhaps it tends to be laced with a flavorless oral cleanser of some sort. This isn't a canonical answer at all, of course.
As an aside, if you are interested in the state of dentistry and oral hygiene in SF, I'd recommend you check out Prostho Plus. In it, a prosthodontist gets kidnapped by aliens and sold as slave labor around the galaxy (good dentists are hard to come by even in space, it seems). It's, if you'll forgive the pun, a very tongue in cheek book.