A patent is essentially a contract between the State and the inventor. In return for disclosure of the invention to the public the inventor is granted a monopoly, limited in time (usually to a maximum of 20 years). It follows directly from this basic principle that if the invention is already in the public domain then the inventor brings nothing to his side of the deal. Thus, if you disclose your invention (other than under terms of confidentiality) before you file a patent application you can expect to loose the right to an enforceable monopoly.
It is also important to understand that a patent gives you the right to stop other people using your invention without your permission. It does not give you the right to implement your invention. For example, if you invented a new steering system for cars you would not be free to make and sell cars having that new steering system if someone else still had a valid patent covering the basic invention of a car.
Although there are several supranational patent (application) systems, all patents are still essentially of a national character. Thus a UK patent will give you the right to stop other people e.g. making, selling, or importing your invention in the UK but if you wish to stop such activities in another country you will also need a patent in that other country.