You may or may not be able to apply for a US student visa from a third country. If you're planning on applying for a visa to visit the US, then you should first confirm that the country where it's located in a third country. You should also be able to provide proof of finances to study in the US along with your intention of returning upon graduation.