The washing machine drain pipe goes through a hole in the wall. But there is a gap in the hole. Is it ok to block this gap, with a cloth or something more professional? Because maybe cockroaches can come out of it.
Most of us are located in the United States. The first thing to do is to find out to where the other end of the washing machine hose discharges. In the US, they usually discharge with an air break into a "standpipe" that has a P-trap at the bottom. And we often use a washing machine drain/valve box to organize the plumbing. See below.