I don't know if you noticed, but you made a slight change in topic.
DanBC's comment was that there are cases where workplace sex discrimination is allowed, because they are part of the primary purpose of the company.
For example, the Playboy club can decide to only employ women as hosts, and require them to wear bunny costumes. This is a requirement for the type of service the Playboy club provides.
On the other hand, Hooters cannot refrain from hiring men as hosts, because Hooters is primarily a restaurant. (I apologize for not knowing the UK equivalent for this example.)
Wearing high heels is not a requirement of secretarial work, so this exception does not apply. But a company can still regulate clothing even if not part of the job requirement.
In Sweden, where I live, it is not (I believe) legal to discriminate based on sex for the dress code. That does not mean there is a "harmonised unisex dress-code." For example, a few years ago the temperature in Stockholm was so warm that the male underground operators wanted to wear shorts. This is not allowed by the dress code. It is allowed to wear skirts, which is what they did. (See for example http://www.hurriyetdailynews.com/Default.aspx?pageID=238&nid... ).
Under that framework, you should have been allowed to wear sandals and low-cut tops, and the women should be allowed to wear a suit and tie.