An allergic reaction will not occur on the first exposure to a substance. The first exposure allows the body to create antibodies and memory lymphocyte cells for the antigen. However, drugs often contain many different substances, including dyes, which could cause allergic reactions. This can cause an allergic reaction on the first administration of a drug. For example, a person who developed an allergy to a red dye will be allergic to any new drug which contains that red dye.
A drug allergy is different from an intolerance. A drug intolerance, which is often a milder, non-immune-mediated reaction, does not depend on prior exposure. Most people who believe they are allergic to aspirin are actually suffering from a drug intolerance.