One method is to construct the box especially for the truck and install it in the bed. It's also possible to buy a premade wood dog box and install it, but the directions vary according to the manufacturer.
To make a custom wooden dog box, measure out the sides, front and back of the box. Use a jigsaw to cut them out of pressure-treated wood. Decide on the placement of the air vents, and draw them onto the wood. Use a power drill to create a pilot hole, and cut out the vents. Measure and cut the door in the same manner.
Cut pieces of galvanized fencing so it's 1 inch larger than the vents, and affix it using stapes. Measure and cut a plywood frame for each vent. Affix the frame over the vent to protect the dog from the edge of the fencing.
Use L-hinges and screws to construct the box. Cut the fencing and two frames for the door using the vent method. Use screws to sandwich the fencing between the frames for the door, and attach it using hinges. Affix two handles to the sides of the box and two strips of wood to the bottom of the frame. Fold a piece of tarp in half, and affix it to the top using wood screws and pressure-treated wood.
To install the box, attach four eye bolts to the truck bed, two on either side lengthwise. Align the bolts with the handles. Use bungee cords to attach the handles to the eye bolts