If you have plaster directly over the brick wall, and the plaster is deteriorated from water, then remove that plaster. You can tell where the plaster is still bonding well to the brick by knocking on it with your knuckle. If it sounds "hollow" then it's not adhering to the brick.
What I do is knock along the bottom edge of the plaster and draw a line between the plaster that sounds solid and the plaster that sound hollow and cut through the plaster along that line. Then remove the plaster below the line.
When it comes to inset soap dishes, I paint the inside of it with a concrete bonding agent (or a white wood glue would also work) and screw a piece of thin plywood to the masonary wall over MOST of the opening, leaving the top inch or so of the hole exposed. Then I mix up some perlite with portland cement to make a lightweight perlite concrete (which actually floats when dry) and fill the cavity to the top of the plywood with that. (Or, just buy a bag of brick mortar and use that.) Allow to set overnight or longer and then fill the top inch of that hole with more mortar.
And, once you get the plaster off, get some wood moldings the right thickness and fasten them to the brick wall (or stick them to the wall with double sided mounting tape) horizontally so that they support the thin set from slumping. Now, just build up the wall to it's original position by trowelling on the thin set between the wood strips.
Painting the brick with a concrete bonding agent (or diluted white wood glue) before spreading the thin set slurry will help it bond to the wall better.
You won't be able to put the thin set on a full 3/4 inches thick (the thickness of the missing plaster) without it slumping, so put it on in several thin coats (like 1/4 inch each on), and for the final coat, use the wood strips as screeds. After the thin set hardens, cut through the thin set on both sides of the wood strips with a plastic laminate knife (the kind with the single tungsten carbide tooth on the end of the "blade", and remove the wood strips. Then fill in the gully where the strips were.
If you use a "dry set" mortar (one where no polymer has been added in powder form), then the thin set will dry soft enough to sand off easily with 60 grit sandpaper, making it easier to get the wall smooth and flat. You can then paint over that dry thin set with the recommended additive diluted with water so that it wicks into the thin set and makes it harder, giving you a hard strong surface to tile over.
I've done 20 bathrooms just like that using Mapei Kerabond thin set and Keraply or Keralastic to build the wall back out as described with no problems in 20 years so far.