As Mamya said, you can ask for help, but the only way you can be admitted to a NHS hospital is if a Dr admits you.
Being sectioned under the mental health act is a very serious thing with many implications for a person's future. Being sectioned is never done lightly and is bound up with many conditions which must be met before a section can be done.
Not many people are sectioned, ie detained against their will.
If someone has agreed to go into hospital, they are free to leave at any time.
If the person that you speak of did not meet the conditions for being sectioned, then the staff had no option but to allow him to leave .