I am allergic to penicillin and I have tonsillitis what should I do if surgery?

Alternatives. There are plenty of non-penicillin alternatives that can be used; Erythromycin is one of the most common. If you really need to be treated with a penicillin derivative, your allergist can desensitize you prior to starting the antibiotic. But it is always best to use an alternative so that you don't run the risk of having a penicillin reaction.
Different drug. Fortunately, penicillin is not the only class of antibiotic that can be used to treat tonsilitis. Other classes of antibiotics also are effective. In some circumstances when only penicillin can be used, an allergist can actually desensitize an allergic patient to the medication. This is not permanent however; that is, the desensitization effect goes away when the medication is stopped.