The boss of Primark has resigned after an allegation over his behaviour towards a woman.