Does anyone know how to draw these kinds of diagrams in word or any other program?
That appears to be hand drawn. meaning those brackets were each individually created.
But it was made using text boxes and the Drawing toolbar. There might even be some premade shapes that will do what you want. Give it a shot.