If you come from another EU country and want to work as a self-employed prostitute in Germany, you have to report your place of residence to a registration office and your activity to the tax office.
If you come from a non-EU country, the immigration office checks your residence status and whether you are allowed to work in Germany. As a tourist, you are generally not allowed to work. Keep in mind that the prostitute protection law has been in force in Germany since July 1, 2017. Before starting work, you must undergo compulsory health advice and registration (see section on prostitute protection law). This law also applies to EU citizens who want to work as prostitutes in Germany.