Short answer: Yes, a 2013 iMac is "safe" to use with the Internet.
A bit longer answer: All of the 2013 iMacs are capable of running macOS Catalina. Although a bit behind the most current version: macOS Ventura, it is still very capable and secure.
FWIW, I still have a couple, much older, Macs that are running macOS High Sierra. I don't have any issues using them, security-wise, with the Internet.
After you power up your iMac, check to see what version of macOS that it is running. You can do that simply by first clicking on the Apple icon on the upper left-hand side of the macOS menu bar. Then choose "About This Mac." The operating system should be listed.