Can I apply to take the exam if I am not a US citizen?

In general, the answer is “no,” however there are exceptions. Applicants who are not United States citizens and do not reside in the U.S. are not eligible for registration except if the individual is registered to practice before the patent office in their country of residence AND if their country has a reciprocity agreement with the U.S. (Canada is the only country with such an agreement at this time).

There are some other exceptions and can be read here.

Wysebridge Patent Bar Review