thank you for your question. Yes, you can do the process of "Berufliche Anerkennung" while you're still in the asylum process. You mentioned that your hearing is soon to come, after this you will know whether you will be recognized as refugee (or get subsididary protection or deportation ban) or if the court rejcets your appeal. In this case, Germany will ask you to leave the country and give a Duldung in the meantime.
If you get a residence permit through your asylum case, work is no problem.
If you get a Duldung and aim at receiving a residence permit through your job, the Ausländerbehörde will probably ask you to leave the country and go through the normal visa process.
Another option, in which you don't have to leave, is the Ausbildungsduldung or Beschäftigungsduldung (especially the Beschäftigungsduldung is hard to get, the rules for this are very strict).
In any case I recommend you talk to your lawyer and/or a refugee advisor. They can also help you talk to the Ausländerbehörde.
I hope my answers were useful for you and I'll be very pleased if you contact me again with further questions. I'm a member of the MBEON-staff and I‘ll be glad to guide you over a longer period of time. Mbeon is an online consultancy for migrants via the mbeon-app, which you can install on your smartphone for free. Download it via App Store or Google Play Store. You'll find me In the mbeon-app (search for „Euskirchen, Frau Schaefer“) and get confidential one-to-one advice in a safe virtual room where nobody can wiretap messages. Further information: www.mbeon.de