Using hard disk after a S.M.A.R.T. error
I would like to know if it's safe if I continue using this hard disk
  (for example as an external one). If not, why exFAT says all is right?


No, it is not safe and exFAT is not saying it's all right.  Disk Utility is just not telling you that's something's wrong when it writes the exFAT partition.

A S.M.A.R.T. error is an error that is generated by the drive itself (not macOS) and this cannot be overridden by a format type (exFAT, APFS, HFS+, etc.)  The reason one format generates an error and another doesn't has to do (basicailly) where the partition is actually written to the physical disk.  With exFAT, that "bad" area isn't being written to, thus, no error.

Bottom line, the drive is proven to be failing; I wouldn't continue to use it.