Is it possible to do a self-funded Ph.D. without masters in Germany? Is it ok if someone writes to professors asking for a Ph.D. position in his lab? Will they take students if its self-funded?
I cannot comment due to low rep. There are fast-track PhD programmes in Germany, but a bachelor degree is necessary to enroll in such. Often PhD students are payed for teaching duties 50% TV-L, engineers mostly 100% from group budget and/or external funding. But this often implies trying to use results from such external projects for the PhD thesis. When you are paid by university/group budget for teaching duties, your PhD work is often more or less your private hobby/side job apart from teaching. This varies heavily among different universities, for humanities sometimes people working on a PhD have no long contract (> year) or only a temporary one (during semester for some month) to my knowledge. In STEM, especially if you work in experimental scienes (using facilities/expensive devices), a master degree is necessary. I didn't hear of fast-track programmes there, but I'm sure very bright students in theo. physics, computer science, math... could find a university willing to let them start PhD without a masters. In experimental sciences I would not recommend it, as a researcher needs to gather experience in small, mid, big (bachelor, master, PhD) projects in my humble opinion and the risk would be unnecessarily high that the phd students fails or needs more time for his PhD than master graduates.
So these are some hints how the system works. Technically I think there is no-problem to do a self-funded PhD and in the spirit of open/citizen science I would promote it, how big the likelihood for this is that some Professor is willing to let you work in his group, advise you, spends time, offers you the use of his devices probably depends on your branch, research idea (you should have one), pre-results/experience, less on grades as we have an inflation of very good ones in Germany.
But, in my opinion, there has to be a strong link between your bachelor work/experience and the future PhD work (theory and methods), otherwise I would not start to search for a group, as the professor will have to deal with additional bureaucracy for your case.
The other thing is, it's better to have publication(s) in peer-reviewed journals before submitting a PhD thesis to the faculty. You need the name and institution of your professor to gain some likelihood that your papers get into review at all. Uploading your "stuff" to arxiv.org will not be sufficient... Finding a professor for self-funded fast-track PhD is one thing, the other one is not to get robbed of your results after years of research if you technically do it privately. This risk is uncalculable. Personally, I would only think on self-funded PhD under supervision of a full professor with permanent position in his 50-60s ;-) And such ones have on average per month a few hours to talk to their PhD students...
To conclude, technically possible or not, there are a lot things you should think about and outline and check in advance before starting a PhD odyssee. But also, when you do non-self-funded one. I see to many just jumping into a PhD due to wrong reasons or without good reasons, about the failed PhD's you can read nowhere.