There are so many different types of mods/formats that it's hard to outright say if it's safe if it isn't.
I've been an avid PC gamer for around 15 years and have created/downloaded countless mods. I've never been infected via a mod, but my PC was almost infected via an unofficial patch update for an older PC game.
I feel it's important to familiarise yourself with file types and extensions, including their expectations and capabilities, prior to downloading/modding games.
There's also a few important factors to check as well:
- Is the size of the file and the type of file expected for that specific mod? (i.e a texture replacement mod is usually .archive or an image format, so if it's a .exe then that's a red flag).
- What is the source of the mod, did you download it from a reputable website i.e NexusMods or a random Warez site? (There's dedicated modding websites which are certified and have in-house monitoring, stick to those!)
- Is the uploader reputable/long-term history of uploads with no issues? (If the uploader is new with no previous uploads/posts, be more hesitant and take extra precautions).
- Is it injecting anything into your memory/game, or is it simply a texture replacement file or read-only script? (Links in with file format familiarity - it's rare a mod will be a .exe or .bat format so if it is, then there'd be a cause for concern).
- It's worth noting, most malware, viruses and keyloggers come from unofficial game patches/keygens/cracks - as opposed to mods. (Typically .exe .bat powershell formats are the most risky)
Also ensure that anything you do download is checked via your security vendor; malware scan etc. Usually done automatically, but manual scans of files are definitely recommended, and if you're really concerned the file can be uploaded to Virustotal.com. Some mods/patches are .exe files which can be totally legit, but these should 100% be scanned and opened in sandbox mode if possible.
But the most important thing; common sense, taking your time and if ever unsure ask for advice. (Google and a bit of reading does wanders for a concerned or hesitant mind!).