Hello Razna,
Thanks for posting here, I'm very willing to help you.
For your question, Microsoft allow organizations search users private data for some legal reason(for your reference:
If your school have some legal reason they can use content search to search not only your chat, but also your email, files and so on, for more details, you can refer to this article.
Hope this can help you, if you need any further help feel free to contact me 😊
Wish you have a nice day.
Best regards,
Regina