The university can try to punish you for things you say or do on TikTok, but are they within the rights in doing so? Possibly not. Depends what's, of course, set or posted on TikTok in terms of the school is going to be within its rights to do so. If it's sexual in nature, racial threatening, it's going to be a certain consideration. A student does have an obligation to live by the specific policies at play. It's a code of conduct, whatever other policies may be involved.
If it's a matter of posting something on TikTok that something disagrees with or it just takes an exception to what because they have a different opinion and the school tries to punish or discipline a student in that regard, school very well, maybe and very well likely would be outside his bounds in doing so.
Having an experienced attorney advisor is going to be your best ally and understand your rights and protecting your rights and help you navigate the process moving forward. They should be involved as early as possible in the case.