Which type of mortar or cement to set electrical box?
they make specific boxes for masonry.  these are sealed a bit better than a typically 4 inch square.  you can get these in single gang, up to almost anything multi gang or gangable (single gang that join to other single gang to make what you need)  You must use rated wire or conduit with compression connectors for this application as well.