Can filesystem get damaged after freeze and automatic restart?

What if the system freezes and then after a few minutes it restarts by itself? Does that damage my file system?

Depends on what did the restarting (hardware/software) and if the kernel could sync and finish possibly pending write operations. In general I wouldn’t rule it out and always check all the filesystems for errors/consistency after such incidents.