People compliment strangers on LOTS of things - their fashion, physique, their cars etc. so long hair shouldn't be a bridge too far. But like another commenter said, just don't be a creep about it e.g. ask to touch or something (if they consent cool but there's a good chance you'll come across as a creep by asking).