Can a person be tested ahead of time to see if they are allergic to the anesthesia?

Yes and no. There are multiple drugs given during anesthesia, any one of which can theoretically cause an allergic reaction. It would be very expensive for you to have this done, and I am fairly sure that a health insurance plan would not pay for it.
Not necessary. There's only one kind of "allergy" to anesthesia that would be of great concern; that is malignant hyperthermia. If that runs in your family, you might consider being tested. It's not really an allergy though. Otherwise, there's no need to test for allergies to anesthetics.
Yes. If you or a family member have a history of anesthesia complications or allergies it is prudent to arrange a preoperative visit with your anesthesia doctor so that the risks are properly assessed. Usually allergic reactions to anesthetic agents are rare. However, those who are allergic to soybean or eggs should not receive propofol. Other patients may be allergic to local anesthetics (procaine).