england-and-wales
Yes it is legal. There is no law prohibiting such behaviour.
A restaurant menu invites people to ask for items on the menu. People are free to make other offers too, e.g. "no cheese" or "will you add an egg?" or "will you accept £10 for the burger, it's all I have?"
The customer is free to make an offer and the restauranteur is free to accept or refuse the offer. "No I don't want to sell you a burger patty on its own for £3."
Unfair contract terms seem irrelevant because there is no contract at the stage when the customer asks the restauranteur for a food item.