Yes it is legal.
Your wife can speak with the chain of command in a professional manner. If your wife becomes unprofessional and refuses to correct bad behavior when addressing the chain of command they can take action against her including revoking all privileges such as: PX, Commissary, MWR, Housing, etc. They can also initiate UCMJ action against you for failing to control your dependents. I have personally witnessed a Soldier receive an Article 15 because the spouse enjoyed cussing out the commander.
With that stated you wife has several courses of action. If she has a valid complaint she can speak with the IG or JAG. If she chooses to speak with the IG it can be kept between the IG and your spouse as long as your wife asks them just for advise and request they do not contact the command. This request can also be made over the phone and in an anonymous manner. It is very important that your spouse sticks to the facts and does not become emotional or unprofessional as this will only cause you and your family additional problems. In addition should your spouse choose to make complaints that are not true this can also have a negative impact.