They are not.
Mac OS X is derived from BSD UNIX. The Linux kernel was basically written from scratch, but is more closely related to Sys V.
Please see the UNIX family tree.
They're similar enough that Linux users can easily migrate to Macs and continue to use the command line interface they're accustomed to.