It depends how it's expressed. Sexual attention gets put in a negative light because it's often portrayed in rude ways like catcalling, or in a very offensive and vulgar way. No joke, as I was walking down the sidewalk one day a guy said, "Hey baby, I'd like to get in between those legs." It was uninvited, it felt intrusive, and it made me uncomfortable. Another guy went as far as to take a picture of my crotch, show it to me, and then tell me he was gonna jerk off to it that night. Thoroughly creeped me out to the point that I was shaking--it was just so violating!
However, if a stranger expressed in a KIND and RESPECTFUL way that they thought I was attractive, I'd be okay with that. Such as "Hey, that color looks really sexy on you." or something like that. But not in an intimidating and leering fashion, in a sincere complimentary fashion.
I hope this answered your question? If I didn't tell you exactly what you wanted to know I'd be happy to clarify.