According to the Brazilian Health Regulatory Agency (Anvisa), generic, reference and similar drugs can be defined as:
Generic Drug: drugs that contain the same active ingredient, in the same dose and pharmaceutical form, are administered by the same route and with the same dosage and therapeutic indication as the reference drug, presenting efficacy and safety equivalent to the reference drug, and may be interchangeable with the latter. Generic drugs can be identified by the yellow stripe that reads “Generic Drug”. Since generic drugs do not have a brand name, what you read on the package is the drug’s active ingredient.
Reference drug: an innovative product registered with the federal agency responsible for health surveillance and marketed in the country, the efficacy, safety and quality of which have been scientifically proven to the federal agency.
Similar drug: drugs that contain the same active ingredient(s), present the same concentration, pharmaceutical form, route of administration, dosage, and therapeutic indication. It is also equivalent to the reference drug registered with the federal agency responsible for health surveillance and interchangeable, when it presents equivalent efficacy and safety, and may differ only in characteristics relating to the size and shape of the product, shelf life, packaging, labeling, excipients and vehicle, and should always be identified by trade name or brand.
Source:
https://www.gov.br/anvisa/