"Everything in real estate is negotiable."
If you sign a listing agreement with a real estate broker in which it is agreed for the listing to be in-house, it is not illegal.
If you sign a listing agreement in which the broker agrees to place the listing on the multiple listing service, and the broker does not, the broker is not fulfilling his end of the agreement.
The multiple listing service is an offer of the listing broker to compensate another broker if that other broker procures a buyer.
Although, each multiple listing service board may have their own rules for member brokers regarding in-house listings.

