To work as a self-employed person, your residence permit should specify that you are allowed to do so. (You should be able to read „Erwerbstätigkeit gestattet“ or „Selbstständige Tätigkeit gestattet“ on your residence permit.) That would be the case, if your entitlement to refugee protection, right to asylum or subsidiary protection is recognised.
If you already are in Germany and your residence permit does not allow self-employment explicitly, you have to ask for a permission according to § 21 Abs. 6 of the Residence Act at the Foreigner’s Registeration Office („Ausländeramt“).
If your deportation is temporarily suspended ("Duldung") or your application for asylum is still pending, you cannot work as self-employed.