Yes, you can. There are multiple ways to compress a file on Mac for you to choose from, including macOS built-in function, online compressor, third-party compressors for Mac, and Terminal commands.
When you compress a file on Mac using the Compress option from the context menu, it automatically saves the file to the same location with the extension .zip behind the original file name such as "Untitled.txt.zip." This won't change the file name.
Similarly, using the Terminal online compressor, and a third-party compressor for Mac won't change the file name of the compressed file. Some may change the name of the .zip archive files, you can see the compressed file with the name of the original one after unzipping them.
Besides, a third-party compressor for Mac such as iBoysoft MagicMenu provides more customizable options to allow you to select a compression level, encrypt the compressed file, assemble multiple files into one.zip archive file, etc. Download it free now!