At UK elections, it is for candidates themselves to determine whether or not they are eligible to stand for election. The Returning Officer's role is to ensure compliance with the procedural requirements relating to the information to be provided in the nomination papers.
Mechanisms exist for the removal from office of candidates in UK elections who falsely claim eligibility to stand and are elected, but are subsequently found to be ineligible to hold that elected office.
There are currently no penalties that attach to the candidate other than their removal from office. However, the Electoral Administration Bill will make it an offence of corrupt practice for a candidate to knowingly give a false declaration in a nomination paper as to their qualification to stand.