apt, the package manager, is a Linux tool, from Debian GNU/Linux. macOS does not have it.
There are projects like Homebrew, MacPorts and Fink that provides packaged third-party software for macOS.
NetBSD's pkgsrc also works nicely on macOS: http://www.pkgsrc.org/
md5sum: On the BSD Unices, of which macOS is one, there is often a utility called
md5 available that performs the same service (but with slightly different format of output).
If you install GNU coreutils using the tools provided by one of the above projects,
md5sum will be installed. The executable is sometimes called
gmd5sum (note the added
g prefix, which also gets added to all other GNU coreutils executables).