Using subdivide I could achieve something below, but it's not what I want. How could I subdivide the hollow rectangle from the inner side? I need the the surface between crenels to be parallel
2 Answers
Use the knife tool to cut these orthogonal edges (K to activate, A to cut orthogonally, C to cut through):
You end up with this, don't forget to remove all the oblique edges:
Create some loopcuts with CtrlR:
Extrude up the crenels:
If I'm understanding your question correctly, I have a solution assuming your cube is oriented perfectly to the X and Y axes (as I'm sure it will be)
From what you've got here, select one of your inner-facing edges and then scale it by 0 along either the X or Y axis, depending on which way it's facing.
I'm not able to get into Blender right now so cannot show a screenshot, but the easiest way is to select an edge, then press S, X, or Y, then 0.