Yes toothpaste does work great to clean glasses and remove any scratches from glasses but just be sure to use the non abrasive kind of toothpaste to clean your glasses with.
To clean your glasses with toothpaste take a cotton ball and dab a little of the non abrasive toothpaste on the cotton ball and then gently rub the eyeglass lens using a circular motion.
Wool cloth also works if you don't have any cotton balls on hand.