Dear @A-Safi,
thank you for sharing your question with the Wefugees Community.
Of course, you can apply for it. However, it depends on your individual case, whether you can get a protection or not and which type of protection you can get. In addition, if you have got a scholarship for your study program in Germany, you should clarify it with your scholarship sponsor whether they will finance your study after your asylum application or not.
In addition, I hope you have not signed anything about your obligation to return to the country, from where you have come, at the end of your study. Because, this might also create a bit problem during your asylum procedure.
You can also think about the option of continuing your study program till the end and finding a work in Germany after ending it. Because in such a case, after the end of your study, you will have 18 months to search a work for yourself, which matches your qualification. If you find one during or after these 18 months, you can get a residence permit and stay in Germany based on it.
I hope, you have got your answer. I am a MBEON consultant. If you wish to contact me directly, you can see my profile and follow the instructions there.
Best wishes
Fardeen Noori