Best time to explore would be at the start of mission 16. You'll have both the cutting torch and the hack tool fully upgraded, so you'll be able to access every room.
Not sure if its still possible to go back at this point but you are safest after the gemini module has been expelled, you won't have to worry about the xeno until the hive I believe. The Joes are still going to be about though.
Is there a good point towards the end of the campaign where you can feel free to explore the previous areas of the game? I just want to go back and appreciate the visuals without the threat being chased. Hope this makes sense.