An employer can’t refuse to employ you just because you’re pregnant. They should base their decision on whether you have the skills to do the job, not on whether you are pregnant.
You don’t have to tell the employer that you’re pregnant when you apply for the job. If you do tell the employer you are pregnant at interview and are not offered the job because of this then this will be discrimination.
If you don’t tell the employer that you’re pregnant and they give you the job, they must not dismiss you when they find out about the pregnancy.
Example
You apply for a job as a training instructor. On the basis of your application form and interview, the employer decides you are the best person for the job and offers it to you. But, you’ve just found out you’re pregnant and tell the employer when you accept the offer. The employer changes their mind and withdraws the job offer. This is discrimination and cannot be justified. You can make a claim about it to an employment tribunal.