While anyone can have a cavity, and it’s impossible to say “No, you don’t have dental caries,” it’s unlikely from your description that this is causing your current problem.
If you receive normally competent professional dental maintenance, and if, as you say, you regularly brush (and floss?) your teeth, then it’s unlikely that caries would advance to the point of pain without prior discovery and treatment. That is to say, cavities generally cause pain only when they have advanced so deeply that they affect the dentin beneath the enamel of the tooth and then penetrate to the nerve. That penetration (and exposure to air) causes the pain – inside the tooth. In other words, a rotten tooth, which you would see (and probably smell) long before it advanced to a point to cause pain.
However, a more likely cause of “sudden onset” of pain in the area of a tooth is because of infection beneath the gums or at the base of the tooth. One cause, especially in younger people, can be an impaction of an erupting tooth into an existing one. Again, regular professional care (and X-rays) will bring to light the pending impaction long before it occurs, and lead to advice from the dentist on how best to address that. But inflammation beneath the tooth itself (a decaying root, for example) or under the gum line can occur without much warning.
Another cause of pain that appears to be “in a tooth” can be from a receding gum line which exposes more of the root of the tooth to air – and to hot and cold sensations. So-called “sensitive teeth” are a result of receding gums at one or several teeth, which causes this condition.
See your dentist.