Some programs do not lock temporary files. One example would be a setup program. It stores some temporary files and uses them when the installation process begins (creating them when it starts).
That said, however, I haven't really encountered any problems deleting such files. Nevertheless, I would only delete the files in the temp folder to be sure.