This is not a question we can answer here with a clear yes or no. People from safe countries of origin only receive a refugee status in rare cases. If a person makes an asylum application, the authorities examine whether they are entitled to different types of refugee protection status. One of these is called deportation ban (Abschiebungsverbot). People are given this status for various reasons, including for having medical issues. However, the medical issues must be extremely serious or life-threatening to be given this type of permit. It is not relevant if the medical services on offer in the home country are not as good as those in Germany. It also does not matter if the required medical treatment is only in certain parts of the home country.
Such as person would have to prove that there is a concrete danger to their life if they were to be returned to their home country. They would also have to provide extensive documentation to support their case from medical professionals in Germany.
People under 18 who are not with parents or guardians are generally not deported from Germany. If their asylum case is rejected, they receive a temporary paper called a ‘Duldung’ until they are 18. Once they turn 18, they can be deported.
If this person wishes to live and study in Germany, then they can **** at the requirements for a visa to come to Germany and study on the website of the German embassy in their home country.