I was searching Windows 7 themes and some of them require replacing ExplorerFrame.dll. I am wondering if this is safe. Is a DLL only a container of resources or might it contain code that can be run by Windows?
ExplorerFrame mostly contains resources but all DLLs contain code that can be run by Windows; even resource-only DLLs contain code (that might by normally do nothing) that automatically runs when the DLL is loaded. It’s part of how DLLs work on Windows. So you would have to make sure you are getting it from a trusted source, and even then you may have compatibility issues. You would certainly want to make a backup of the existing file and a restore point even if you do trust the source, and have your antivirus and antimalware software running. However, I can’t give advice without the disclaimer that you never know.
It’s never guaranteed safe and in this instance, it’s a hack. Even if this particular situation happens to be safe from a security point of view (and even if everybody else who used the replacement gave it glowing reviews), compatibility issues with e.g. old patched versions of the DLL not being updated for new windows updates can always arise and manifest themselves in seemingly unrelated ways.
Personally, I would avoid it. With sufficient motivation, knowledge, and care you could certainly increase the chances of safety and diagnose / recover from resulting problems (e.g. try it in a sandbox, examine the code, obtain the source -> assess -> compile yourself, etc., not generally within the realm of every-day experience), but the general advice is to avoid.