I wanted to know if it is possible to change kernels, for example, replacing Fedora's Linux kernel to that of FreeBSD's.
Now, there already existed the Debian GNU/kFreeBSD. Is it possible for me to customize a Linux distro to contain a BSD kernel?
No, each kernel implements its own features in its own way. There's a large amount of POSIX compatibility but once you get out of that the executables need to be compiled with the kernel mechanisms already in place. Many projects contain source code that only gets compiled if you explicitly say that you're compiling for FreeBSD or Linux. That's essentially what kFreeBSD is. The tools support the FreeBSD kernel but they have to be compiled for it.
For example, if you try to use
epoll_create on FreeBSD things won't work as expected.
Of course, you can cross compile the tools from a BSD system LFS-style but that's likely to take forever. Not as simple as just compiling a new kernel.
FreeBSD doesn't use a Linux kernel - as its name suggests, it uses a BSD kernel.
It is possible to replace a Linux kernel with a different Linux kernel (either one you built yourself or one you extracted from a distribution). Do be aware that the user-space programs in your distribution may depend on particular kernel features to be compiled in, and may not work properly if you run them on a kernel built without those features. For example, a systemd-based distribution will require cgroups in the kernel.
For the example you mention, yes a GNU distribution can be built for a Linux kernel or for a BSD kernel. In many cases, there are compile-time differences (e.g.
#ifdef) between programs compiled for the two, even if the kernels advertise the same ABI. At a minimum, the low-level libraries such as the C Runtime Library have to accommodate the differing kernel ABIs.
Kernel is the independent part and is routinely replaced during the operating system updates. Some proprietary drivers (NVIDIA, etc) have the installation scripts that patch the driver into the kernel source, build that kernel and replace the current kernel with it. Hence if you develop your own kernel version that can perform all required functionality, should not be a big problem to plant it in and leave the rest of the operating system around. However most often such a "new kernel" is derived from the recent official version.
Solaris kernel has been ported this way in some degree, resulting OpenSolaris running Gnome environment.
Still, putting the completely different kernel is the significant effort, as interfaces must be bridged. This is likely to require lots of C programming and is not just about the build script.