Yes, you can participate in a mobility programme for a traineeship even if you have previously participated in a mobility programme for study purposes.
If you participate in the Erasmus+ programme, you just need to comply with the 12-month limit for each study cycle (bachelor's, master's or PhD).
If you are a non-EU student, however, the overall limit is 360 days.