I'm installing a window type 5K BTU Haier unit this weekend on my build, at least I hope it gets finished by Sunday night. It measures about 16" wide, 12" tall & 14" deep. On the model I have, the side vent slots are 9" from the back edge (the outside edge), the top slots are 8" from the back. Mine will slide out to only about 6" past the box edge so it lacks a completely open back, but there's enough side & top clearance inside the box opening to let the air be drawn in on the sides & top (to push it out through the back) with the fan running.
You have to allow for enough free airflow or it just won't run properly & efficiently. Did I compromise the airflow? Yes. Did I leave enough clearance for it to still work? Yes.

We did a test run last weekend & it works great. The temperature inside dropped from 86 to 64 in about 20 minutes, so it's getting enough free airflow.
We met a guy with a manufactured teardrop in Flagstaff, who said his air conditioner just couldn't keep up with the heat in Arizona. His installation has a roof type vent above the back of the AC unit, which is mounted in the footboard/galley wall & it sits in a box. It will let the heated exhaust air out through the roof vent, but no provisions were made to allow for a free intake of airflow into the box from the back side of the unit (at least from what I saw), so it basically just stews in it's own juices while running.
In any installation, look at the unit you're going to use before deciding where it will go. It needs an unobstructed airflow in the front for cooling in the cabin. Restricted ducts, lots of plumbing & bends take up room, reduce the airflow & create back-pressure the system was never designed to deal with. The small fans aren't strong enough to deal with a friction loss from plumbing. The same is true in the back for the heat exchange. If it can't draw fresh air from outside with the fan & then push it out the back, it will not work properly. It might work, but it won't work very well.
I see too many issues where people put an air conditioner in a box & expect it to work properly. If you put an air conditioner in a sealed box, plug it in and turn it on, it makes heat inside the box, not cold! Take it with a pinch of salt as I'm no engineer, but the units are designed to run a certain way & a lot of time is spent in the design to make it run properly. If you monkey with it, you may hurt the efficiency & function.