Vinegar is acetic acid in water. Acid reacts with bases, and the mineral salts that cause limescale in tapwater are bases.