Employers are not allowed to ask your sexual orientation either on a job application form or during the recruitment and selection process. See the government website for more information.
I think you may find there is an expection to the general rule, and this is for any job that is within a church based organisation – I could be wrong though
Employers can ask this question. There is nothing illegal about asking. If they discriminate against you because of your sexual orientation, then you can complain. Obviously you may feel offended if they ask you and may feel that you should not have to answer that question, but that is up to you. You may it is irrelevant if they ask you at an interview, but they may be just interested in how you react, so think carefully before you answer.