I've done it before, but that was with a box that had a large square opening for bass. I've also mounted a fan on the amp for proper air flow. If you do so, I would recommend adding some type of hardware to the outside of the box that bolts it to the vehicle itself. since everything is in one unit, it makes theft a hell of a lot more possible just by cutting three wires. Mount the amp so that the controls are accessible, you don't want to tear the box apart every time you feel the need to adjust the amp. get one with what I call a bass knob, this would help with adjustment also without having to go to the amp every time.
Many "pros" don't recommend mounting inside the box itself, but some units come with an amp built in and to me there are some situations where an amp strategically placed in or on the box is an advantage., especially in a Jeep.