"The cooks are inside the restaurant."
Translation:Kokkene er inne i restauranten.
I'm quoting Deliciae:
So, they can both mean "inside", or sometimes "within", but as you've gathered they're not used interchangeably.
"Innenfor", and its antonym "utenfor", usually deal with some sort of explicit threshold, border, or limit. It's also used in relation to fields of science, research, work, etc.
"Inne i", or often just "i", is used when referring to (being on) the inside any other thing or concept.
Of course most things and concepts have their limits and borders and so on, but if that's not the first thing that comes to mind when thinking of them, then it likely doesn't count.
Here are some examples to make it clearer:
Innenfor døren/grensen/gjerdet (the door, the border/limit, the fence)
(Inne) i rommet/esken/kjøleskapet/hulen (the room, the box, the fridge, the cave)
"Innenfor" can also be used to mean "further inside" (than something) or "behind" (something).