Pool sandals, Mary Janes, Oxford brogues, stilettos … shoes seem to occupy a powerful place in our collective psyche. Ahead of a major exhibition, Kathryn Hughes reflects on sex, power, fetishism and the fascination of footwear