The technique of brushing matters more than the paste, also many over the counter pastes are fine if used in peanut size amount. Medicated paste can change after your examination with the dentist.
Also ulceration could also be because of an old brush or your overall health condition.
Next Steps
if ulcer stays for long or recurs do visit a dentist.
Health Tips
use warm salt water rinsing for few days for the ulcer to heal.