Whether directories can be hardlinked depends on the filesystem and OS. When macOS switched from HFS+ to APFS, one of the changes was that they dropped support for directory hardlinks.
https://developer.apple.com/library/archive/documentation/Fi...
https://developer.apple.com/library/archive/documentation/Fi...
https://stackoverflow.com/questions/80875/what-is-the-unix-c...
The filesystem has to check for and disallow loops.