It really does not matter how the scratch which marred the surface of your glass-topped dining table got there. What matters is, the scratch is there and somehow you must remove it.
First, you must know how bad the scratch is. A deep scratch may be unable to be removed easily. Run your finger nail perpendicular to the scratch like you are finishing the lower case letter "t". If your fingernail catches in the scratch, the mark is at least 0.004 inches deep. In that event, the scratch will have to be polished out by a professional glass repair shop.
Before attempting to polish out any scratches you must carefully clean the area and remove all food particles and dirt. If the scratch is fairly light and shallow, the website signonsandiego.com suggests using a gentle abrasive compound like teeth-whitening toothpaste or the type of paste manufactured for repairing car windshields. The automotive glass repair compounds are generally for tempered glass, the type of glass which will shatter into millions of tiny pieces instead of a few large sharp shards. The type of glass in a dining room tabletop is probably not tempered glass but when you want to get rid of scratches anything is worth trying. Place some of the abrasive on a soft cloth and rub over the scratch by hand in a circular manner.
The same site talks about a paste which can be made of equal parts of iron oxide, glycerin, and water and rubbed over the scratch until it disappears. Iron oxide can be found in hobby stores where jewelry supplies are sold. Periodically, when using an abrasive compound to eliminate a scratch you will need to use water to wash away the paste and find out how much more needs to be done.
Another compound mentioned on various sites for removing scratches in glass is Brasso, usually used for polishing metal. With any of these polishes, you will have to give plenty of time and effort to make progress. If you notice the glass beginning to cloud even just a little, stop using that particular polish and try another. One note: do not apply pressure to the glass while it is still in its frame on the table or you may end up breaking it.
If the glass tabletop can be lifted out and placed solidly on a flat surface, you may try buffing out the scratch with glass-polishing compound and a power buffer. If the glass is left in the frame when using a power buffer, the pressure will likely break the glass. Glass-polishing compound is sold by glass companies.
Of course, one of the best ways of ensuring a glass-topped dining room table remains scratch-free is to always use table runners and place mats underneath tableware like plates, platters, and silverware. If trivets, salt and pepper shakers, butter dishes, and other accessories do not have felt pads on the surface which comes into contact with the glass top, they should be placed upon a padded table runner.
Some small scratches may appear over the lifetime of your dining table but with effort and patience they may be removed and your table's beauty restored.