You can, and usually should, remove temporary folders. Just be sure you won't need to reinstall that program later at a time when you have no Internet access.
Many programs create their own temporary installation folders.
Sometimes these have names that make the folder easy to identify but other times the name is something weird. Sometimes programs don't delete their own installation garbage. It can be hard to tell what folders are installation leftovers. One way to increase your confidence that you're deleting the right temporary folders is to make a note of the exact time and date you start any installation procedure. I have some files from Microsoft Works that I don't use much any more.