I am a legal-aged student in my country (Australia, so I am 18,) after school I enter a liquor store with the intention to purchase. I am stopped at the door and told that I will not be allowed to purchase because I am in school uniform. There is no signage to indicate that you mustn’t be in school uniform and (as far as I know, based on what I’ve looked up) it is not illegal to serve students in school uniform as long as they are 18. This store has no other dress code and the workers even attempted to tell me that it was illegal to sell to students in school uniform. Is this policy legal, are stores legally allowed to refuse me service based on what I’m dressed in even though there is no signage to say that?
Just because it is legal for you to buy something does not mean a shop is required to sell it to you; many shops in the UK have a policy that anything that requires the purchaser to be over 18 will not be sold to anyone under 25 without identification. This reduces the shop's sales and annoys many perfectly legal potential customers, but the managers think it worthwhile to reduce the danger of inadvertently breaking the law on underage sales.
I don't believe it is illegal to sell alcohol to a customer in school uniform, but it may well be a breach of the school rules (either directly or 'damaging the reputation of the school'), and the store would rather keep in with the school authorities than gain one dubious sale.
The only possible breach of the law would be if the store's policy constituted indirect discrimination; only selling to customers with beards would be sensible from an age-related viewpoint, but would illegally discriminate against women.