My rear rack, which is just a standard one from the bike shop, has a flat piece of metal along the top, and this flat top of the rack has a few holes in it. A piece of 1x4 board fits on the top of the rack, and you can attach it to the rack with some bolts through the board, through the holes on the rack, and then with locking nuts underneath. If you attach such a 1x4 scrap of board to your rack, the problem has been reduced to what you now can attach to that board. That opens up the possibilities of other kinds of fasteners. (I have done this myself, so this is not just theory.)
So here is an idea. Attach the 1x4 to the rack. Get a piece of quarter-inch perforated hardboard (pegboard) cut slightly larger than your pizza box. Screw the pegboard to the 1x4. Put the pizza box on the pegboard platform. Hold it on with bungee cords hooked into the holes of the pegboard (remember that the pegboard is larger than the box).
I use this idea to attach my classic milk crate to the rear rack. The pegboard platform provides a little more support to the bottom of the milk crate. I need the support because sometimes I actually do haul home some milk in the classic milk crate.