Lets say that I want to use Linux kernel, but I want to create some proprietary code on top of it (like create a Linux distribution) and later on sell it combined with the Linux kernel (like Mac did on top of FreeBSD). Is it possible to do so?
The Linux kernel was released under the GNU General Public License version 2 (GPLv2). This means that you can build code on top of it, but as soon as you distribute it (e.g. you distribute software combined with the Linux kernel), your software needs to be distributed under the GPLv2 too (or a license compatible with GPLv2, such as GPLv3 or AGPLv3).
You can charge money for support, for packaging your software (back in the old days, people charged money to put the distribution on a CD), for maintenance,... but all of this excludes distributing your software as closed source, proprietary code.
Your comparison "like Mac did on top of FreeBSD" isn't correct. You're comparing a permissive license versus a copyleft license.
Important: I interpret "create on top" as: your code doesn't merely use the kernel. Your code is linked to the kernel. Your code doesn't work without the kernel.