This comes under Section 11 of the Health and Social Care Act 2000.
Before any major change in NHS services the body responsible for the service has to involve and consult those people/communities affected by the proposed change. They also have to formally consult the relevant local authority health overview and scrutiny committee (OSC). If after all this they make the decision to close the hospital the OSC can object and refer the matter to the Secretary of State who may ask an independent reconfiguration panel to examine the decision. This may result in the body responsible being asked to think again, or they may support the decision. in addition to this people can go to court for a judicial review of the process, which again may result in the decision being stopped. You can find more out about these processes from the following website:
http://www.cppih.org/