Yes and No. In Australia, for example, if a person is telling you to stop breastfeeding resulting in them denying you a service because you are breastfeeding then this is classed as discrimination under the Sex Discrimination Act 1984. The Act makes it illegal to discriminate in the provision of goods and services, accommodation, financial services, employment, sport or education.
Outside the provisions of the Act, it is dependent on the 'harassment' or 'prohibited conduct' law in your state or territory which may make this illegal in certain circumstances. Outside these circumstances there is no law against a member of the public telling you to stop breastfeeding. Regardless, there is no law to say that a mother cannot breastfeed. So even though they may be able to tell you not to breastfeed, you have the right to continue breastfeeding.