Hi and Welcome. My Name is ***** ***** I look forward to assisting you today with your question.
Both phones uses different operating systems. Galaxy phones uses Android and iPhone uses iOS.
Both are entirely different platforams and they are not very compatible with each other. That is why you had issues transferring stuffs from iPhone to Samsung. Even the Apps are designed differently and that is why you had to redownload them. People who use iPhone may not like Android and vice versa.
Re your question, Yes, you can take out the SIM from the S7 Edge and put it back to your iPhone 5.
Follow the steps in here to take out the SIM from S7 Edge --> http://www.droid-life.com/2016/03/02/galaxy-s7-sim-sd-card-how-to/
Follow the steps in here to put the SIM back to iPhone --> https://support.apple.com/en-in/HT201337
If you have any questions or would like any additional information, please don't hesitate to ask
You're very welcome Jeni. If you need any help, please post a reply in here and I will get back to you ASAP.