If you are a refugee, as defined by the UN convention, then no, you can't return to your home country without losing your refugee status. After all, the fact that you dare to return means that 1) the situation in your country has improved so giving you refugee status isn't necessary anymore, or 2) you lied to authorities in the first place to get refugee status.
However,
there are many people who come to Germany as refugees, are not granted refugee status (as per UN convention), but are still allowed to stay for some time ("Duldung"). Reasons for this may be
- civil war in your home country, which is not per se a reason to be granted refugee status, but makes it too dangerous to send you home
- not a refugee yourself, but family member of a refugee, especially a minor
- being a minor, or being in an education that ends with an official job title (Azubi)
- various others
If you have one of these, there might be a chance you can return after visiting your home country.
Also, there are cases when refugees returned to their home country for a short while, and did not lose their refugee status.
This article http://www.spiegel.de/politik/deutschland/fluechtlinge-machen-urlaub-in-heimatlaendern-was-an-der-meldung-falsch-ist-a-1163448.html from Aug 18, 2017 cites the BAMF (Bundesamt für Flüchtlinge, federal office for refugees) with
Anders als Asylbewerber, deren Verfahren noch nicht abgeschlossen sind, dürfen anerkannte Asylberechtigte, Flüchtlinge oder subsidiär Schutzberechtigte nach europäischem Recht mit diesem Aufenthaltstitel auch Auslandsreisen unternehmen. Reisen in den Verfolgerstaat seien kein Erlöschensgrund, könnten nur im Einzelfall zur Aberkennung des Schutzstatus führen.
in English (translation mine)
In contrast to refugee candidates, whose proceedings have not ended, accepted [refugees] according to EU laws are allowed to travel abroad. Trips to the originating country are not a reason to cancel [the status], and can only lead to revoking the protection status in special cases.
The article also says that things depend on the reason of the trip, going for a holiday is a lot more problematic than visiting a terminally ill relative.
So, if you have an important, urgent reason to travel home, you might be able to do so without losing your status. But check with an immigration lawyer first, and do not, under any circumstances, try to cheat the system; you'll be in a lot more trouble in case you're found out. And since authorities are closely watching potential ISIS supporters visiting middle eastern countries, it's almost impossible not to be found out.
Also, with the current political situation (right wing AFD gaining 15% in the elections, mostly by being anti-refugee), the government just can't afford any "I had a great time in my home country, now returned to enjoy German social security" reports. So don't expect any leniency from authorities.
A good starting point to get legal advice seems to be https://www.proasyl.de/asylberatung/ (I am not affiliated with them in any way) - they give free advice, help with finding a lawyer, and if you need a lawyer but can't pay for one, may provide financial support, backed by donations. They will advice you by phone as well as email, and they speak English as well as German. Googling for "flüchtlingshilfe rechtsberatung" will provide many other helpful links as well.