Can you get a CDL even if you have tickets?

So long as they're resolved, and are not still pending, then yes. Most companies, however, require that you have no more than three points on your licence in the past three years.