If operating systems were families, macOS and Linux would not be the same person. They wouldn't even be siblings.
They'd be cousins by adoption.
So, NO. macOS is not built on top of Linux
In the beginning, AT&T created Unix. Due to monopoly laws, however, they weren't allowed to sell it. A lot of organizations licensed Unix and made their own variants; most were commercial ventures, but the University of California at Berkeley made a noncommercial version, called BSD.
Meanwhile, Richard Stallman at MIT came up with an ideology of "free software"—more commonly called "open source" today—and started a project to create a "free" Unix-compatible operating system called GNU. Most of the GNU project went very well, but GNU Hurd, the core kernel component, was repeatedly delayed.*
A young programmer named Linus Torvalds stepped in, starting his own successful project to create a kernel called Linux. When combined with GNU's tools, Linux provided a complete operating system that worked just like Unix, but had been written from scratch and licensed in such a way that it would remain open forever.
Essentially, GNU and Linux are "knockoffs" of Unixes like BSD—very high-quality knockoffs, to be sure, but knockoffs nonetheless. All Unix variants—whether they're modifications like BSD or clones like Linux**—have small differences from each other; in practice, Linux is no more different than any other Unix variant.
That isn't quite the end of the story for OS X, though. Just as Linux adopted GNU's tools but threw out its kernel, Darwin (the Unix part of OS X) adopted BSD's tools but threw out its kernel.
So, to review:
Unix/Linux Family Tree
+----------- Unix - - - - - -+
| (modify) (clone) |
BSD GNU
| (replace kernel) |
Darwin/OS X Linux
If operating systems were families, OS X and Linux would not be the same person. They wouldn't even be siblings. They'd be cousins by adoption.
—
* Why? The theoretically "correct" way to design a kernel is called a "microkernel". In a microkernel, each component of the kernel is a separate program, all communicating with each other. If you want to access a file, you send messages to the file system component; if you want some memory, you send messages to the memory management component; if you want to make an Internet connection, you send messages to the network component. The problem is that this is much more difficult to design and build than the "monolithic" approach, where you build the whole kernel into one big component and allow programs to call into it.
Hurd was designed as a pure microkernel, based on a CMU research project called Mach. It has proven very difficult to implement, though—after 24 years of development, they're currently at version 0.5, which works but not very well. Linux, on the other hand, is a simpler, uglier monolithic kernel which worked pretty well from the beginning; most of the work since has been on expanding its hardware support, improving its performance, and adding new features.
Incidentally, BSD is a monolithic kernel too. Darwin's kernel is actually a weird hybrid—it uses the same Mach messaging that Hurd does, but all the kernel components are in one monolithic process. Mach is simply how programs communicate with the kernel and each other.
** If you want to be politically correct for no particularly good reason, pretend I wrote GNU/Linux here and elsewhere.