There's a lot of confusion around this topic. I work in OH. Everynew starter completes a medical questionnaire. The contents of this questionnaire is reviewed by the OH nurse.
If you tick yes to something on the questionnaire, the nurse will contact you to discuss. She will not disclose any of your health conditions to your employer without your consent. In most cases, you will be declared fit with no comment, or with a note saying that a medical condition has been declared but it well controlled.
Whilst we routinely ask for GP contact details to speed up the process if required, we only write to the GP for further information in about 2% of cases. When a report is returned, we do not inform your employer of any further information without your consent.
All of this is to determine reasonable adjustments and ensure you are safe in your role. In the whole time I have worked in OH (several years), I have only seen 2 declarations that the employee is not medically fit (though to be clear - employers need to provide reasonable adjustments that are sustainable and fit within business needs).
You can obviously lie on your questionnaire, but it absolutely is not in your best interest to do so. I do know of a role where someone lied, adjustments hadn't been put in place, they ended up injuring themselves and also lost their job. If they'd be honest, alternative duties may have be found.