Is it legal for me to write my thesis in my native English and have it translated to German at the end?
This is not a legal issue—at least not at first. If you have copyright of your work, you can at any point in time—even years from now—sign a contract with a professional who will translate the thesis into another language and provide certification of having done so. That would be perfectly legal.

The real question is if your faculty will allow you to have someone else translate your thesis so that you can submit it in German, which is largely an administrative decision that may depend on the university. If it were professionally translated, you would have to disclose that fact as part of the submission since it would technically not be entirely your work. Most theses require such an explicit statement as part of the submission. 

There may be an alternative: you should consult the relevant Prüfungsordnungen (examination regulations) that cover your program. Many programs now permit theses to be submitted almost entirely in English along with a short amount of material in German (usually something like an abstract or summary plus any “pro forma” statements. It may not be necessary to hire a translator if you can do the basic translation and submit in English.