not just dirty, but soap residue. they may be very "clean" but soap kills the head.
there are certain grains that do aid in head retention, however, if it is not a glass problem but recipe problem.
Kegged: Berlinerweisse, Dubbel, Galaxy Wheat
Bottled: Golden Strong, Mild, IIPA, Rauch
Fermenting: Saison, Imperial Wheat Stout, Brett Saison, APA, Brett Roggenbier