Primor is an antibiotic used commonly for skin problems in dogs. it is two sulfa type antibiotics: Sulfadimethoxine/Ormetoprim/
However, it can cause a reaction similar to the one you describe. First would be an allergic reaction. With an allergic reaction, signs may include facial swelling, hives, scratching, and sudden onset of diarrhea, vomiting, shock, seizures, or coma.
I would suggest you stop the drug and contact your veterinarian immediately. They will make sure your dog does not need any treatment for this problem, as well as probably change you to another type of antibiotic.
I agree with Dr. Humpries, I would recommend stopping the Primor immediately and contacting your veterinarian. Primor is an excellent skin antibiotic, and I prescribe it frequently, but unpredictable drug reactions to sulfa drugs (and many other drugs) can occur at any time during treatment, and ulcers in the ears and mouth can be one of the signs. In most cases, stopping the drug stops the reaction and healing occurs within a few weeks; in more severe cases, immunosuppressive medications may be needed to stop the reaction. There are also other causes of ear and mouth ulcers such as auto-immune and tick borne diseases, and if the lesions worsen or don't go away when you stop the antibiotic, then further diagnostics may be needed such as bloodwork and skin biopsies.
Good luck,
Kimberly Coyner, DVM
Diplomate American Collge of Veterinary Dermatology
www.dermvet.com