No one gave them such a right. It doesn't matter what women are wearing. It is simply presumptuous and rude to make such comments, even if they are favourable. Don't ask for her name and phone number. It's an intrusion to ask a person for personal details, unless there is some pressing reason.
Sensitive men wait for women to make the first approach.
If a woman says no to your approach, don't try again. Persistence in this case is continued harassment. There are plenty of places where it is appropriate to meet women, such as dancing clubs, sporting clubs, private parties and singles bars. Don't grab, slap, pinch or otherwise touch. Some men may think that it is flattery when they feel a woman's breast or pinch her rear.