It seems like a typical legal answer, but maybe!
In the UK if you make, or contribute to the making of, an invention in the course of your normal duties as an employee, or duties specifically assigned to you, and an invention might reasonably be expected to result from the carrying out of those duties, rights in the invention automatically belong to your employer. This is also the case if you make or contribute to an invention during the course of your employment (no matter what your duties) if you are employed in a senior capacity (such as being a company director) where you have a special obligation to further the interests of your employer.
Other countries have similar provisions, and it is common for contracts of employment to deal with ownership of inventions made by an employee.
So the circumstances in which the invention was made and your employment must be taken into account in determining ownership. Your employer is not automatically going to be the owner for all inventions that you devise whilst working for them, but in most circumstances, is likely to be.
Wilson Gunn can advise on all aspects of intellectual property protection. Please get in touch to speak to a member of our team about patent protection.