Any drug can cause allergy. However, most drug allergic reactions are caused by a limited number of drugs.
Penicillin and related antibiotics (mainly ampicillin and amoxicillin and cephalosporins) are far and away the most common cause of drug allergy. These drugs have a similar chemical structure and, therefore, people allergic to one of them can sometimes react to the others. (For example people who developed an allergy to penicillin may have the same reaction when taking ampicillin).
Other drugs that cause allergy quite frequently are sulphonamides, anti-epileptic drugs, insulin, vaccines and allergens used for desensitisation.
Cross-reactivity between penicillin and other antibiotics from the same family is not always a rule. However, only your doctor can tell you if it is safe for you to take a related drug. Until he gives the verdict it is best to stay on the safe side and use a drug from another family.
Remember that all these drugs are safe in most of the people and will cause allergy only in those having a genetic predisposition that makes their immune system susceptible to react with the drugs. Unfortunately, so far, it is impossible detect who is going to develop an allergy to drugs before the first episode takes place.