I am writing my masters thesis as an exchange student at another university but it is not necessary to enrol as a student at the other university (like aeismail mentioned). If you need a scholarship then you might want to look for a possibility as an exchange student but it has also additional advantages to go as an exchange student. You get informed by the student administration of the university about several topics.
The most important thing is to ask first at your study administration/students office and afterward to find a supervisor for discussing with him the next steps. The thesis has to be compatible with your home universities restrictions.
Where to search
You can then search for a compatible thesis and research topic.
It depends on the university how they publish the open postions, research projects and theses topics.
Most research groups have their own homepage where they publish open positions or topics for a research project/thesis. You can also write them a polite email to ask for an project you are interested in.
There are also some independent institutes or even companies that provide writing a Masters or even PhD thesis (dependent on your field of research) on behalf of them.