Most women like compliments. Some of them don't mind if it's a bit crude, but then again, you have to know the woman to be able to differentiate what is and isn't acceptable.
I've seen many beautiful women in my day, walking down the street, and if I'm walking with a friend, I will state that I think the woman is very attractive, but only to my friend, and not loud enough to be heard by the woman UNLESS I know them. If I know them (as well as know what they do and don't consider acceptable), I have no problem in giving them a compliment. If I don't know them (in this case, being the "random dude"), I will keep my comments to myself.
And, if I'm walking with one of my female friends (knowing what she does and doesn't consider acceptable), if I hear some random dude shout out a crude "compliment", I will tell the random dude in question to check himself, since he doesn't know the woman. If I find out later that she does in fact know the "random dude", I will apologize to the man in question and go about my day.
If you know them and what they consider acceptable, compliment away. If not, keep your comments to yourself, as you don't know what they do or don't like.