Q:

Do the common programs (for example: "ls", "cat") in Linux and BSD come from the same source code?

Both Linux and BSD have common programs like ls and cat and echo and kill.
Do they come from the same source code, or do both and Linux and BSD own their own unique source code for these programs?

A:

Linux is a kernel.  It does not have the code for applications programs in the first place.
Linux-based operating systems do not even necessarily use the same source code as one another, let alone the same code as on the BSDs.  There are famously multiple implementations of several fairly basic programs.
These include, but are not limited to:

ifconfig had 2 implementations, one in GNU inetutils and the other in NET-3 net-tools.  It now has 3, the third being mine.  (See https://unix.stackexchange.com/a/504084/5132.)
su has 2 implementations, one in util-linux and the other in shadow.  Debian switched from one to the other in 2018, making several old questions and answers here on this WWW site wrong.  (See https://unix.stackexchange.com/a/460769/5132 and, for one example, "su vs su - (on Debian): why is PATH the same?".)
There are seemingly umpteen (actually 4 on Debian/Ubuntu) possible places whence one can obtain the mailx command: GNU Mailutils, BSD mailx, NMH, and s-nail.  (See https://unix.stackexchange.com/a/489510/5132.)

The BSDs are operating systems.   They do contain the code for these programs.  However, there is no single BSD operating system, and the code for such programs does sometimes vary amongst NetBSD, FreeBSD, OpenBSD, and DragonFly BSD.  Moreover, it is definitely different to the code used for the several Linux-based operating systems.
Famously, Apple/NeXT used BSD applications softwares in MacOS/NeXTSTEP but enhanced several programs to support ACLs in ways different to the ways that the (other) BSDs did.  One sets access controls using the chmod command, for example.  So the Darwin versions of these commands are different yet again.
There are three added twists.  
Programs like kill and echo are usually shell builtins.  So the code for these commands varies according to what shell you are using, rather than what operating system.
Then there are BusyBox and ToyBox, available both for Linux-based operating systems and the BSDs and even used as the primary implementations of such commands on a few of the former, which have their own implementations of many commands.
Then there is OpenSolaris, from which come the likes of Illumos and Schillix, with the Solaris implementations of all of these tools, which is different yet again.
There are whole histories here, encompassing the original split between BSD and AT&T Unix, through the efforts to "PD" clone many Unix programs in the late 1980s and 1990s, around three decades of shuffling around after that, the whole open-source release of the code for Solaris, and OpenBSD's reimplementations of several things.  Even the histories of tools that one might be misled into thinking have one implementation such as cron (which a lot of people erroneously think is the original Unix tool, or erroneously think is at least one single flavour written as "PD cron" by Paul Vixie in 1987, or do not realize has workalike replacements written by other people in the years since) are non-trivial.

A:

Are these programs in Linux and BSD the same?

The short answer is: Not necessarily.
The source code of common programs such as ls, cat, echo, kill, etc. depend on what userland they come from. In other words, the userland your system uses. The most common userland used with the Linux kernel is GNU - hence the name GNU/Linux. Other userlands have been integrated with the Linux kernel, however.
The BSD's typically have their own userland that is developed separately from others like GNU. Even the BSD's themselves have different code bases. For example, both FreeBSD and OpenBSD have a "BSD userland", but their code base is different. If you look at their man pages (ps for example), they have different arguments that can be used.
One reason POSIX was developed was to address the issue of multiple code bases. If the common utilities delivered with a userland are POSIX compliant, you can assure that they will work (almost) the same whether they come from GNU, FreeBSD, OpenBSD, AIX, or other UNIX based systems.
As you probably know, the userlands listed above (except AIX) are open source. Feel free to poke around their code repositories and you will quickly see that they are not exactly the same.
Note: Even though GNU/Linux is the most popular, there have been attempts to use a GNU userland with FreeBSD/NetBSD kernels in the past. You can read more about them on wikipedia here.

A:

They have diffent sources, for example: https://github.com/freebsd/freebsd/blob/master/bin/kill/kill.c and https://github.com/karelzak/util-linux/blob/master/misc-utils/kill.c

