Both are possible. In British English, you'd be more likely to hear 'do a course', while American English speakers would be more likely to say 'take a class'.
About the word 'class':
In BrE 'class' has just two meanings in the context of education: a class can mean a set of students ( e.g. "I spoke to the whole class" ) or an individual lesson ("I was late for class")
In AmE there is a third meaning, where 'class' is used as a synonym of 'course'. In the context of US education, a 'class' is a set of lessons and assignments within a curriculum ( e.g. A student might say "I took Dr Smith's class last semester").
A more general point:
Collocations with 'take' are generally more common in AmE than in BrE. For example, you'd be more likely to hear 'have a bath' and 'go for a walk' in a British context, but 'take a bath' and 'take a walk' in an American one. Note my choice of the word 'likely': these are tendencies rather than hard and fast rules.