Upvote:2
Almost all countries have a policy from where you can apply Visa for:
In the case described, the holder of valid student visa in the US should be eligible for Germany Schengen Visa application in the US.
In the case when you are not planning to return back to the country of residency things may get tricker. You should always explain the situation in the application, and tell that you are planning to go back to the third country after the stay. The main concern for the embassy that you have the right to go back for at least one country. So, there won't be any reason for you to remain in the country as you have no place to go.
Finally, If you have a non-standard situation and you have doubts, you should call or write the embassy or consulate before application.