I guess the only thing that would prohibit the use of plastic boxes in masonary is the code section 110.3 (B). Is the box listed and labeled for the use? Most likely it is not. Would I red tag the job because of it? Most likely not. As long as there isn't big gaps around the boxes which would allow the water to get inside the masonary wall.