Yes, however...
You'd need to be careful about transmitting. Being that close to a transmitting antenna isn't a good idea. Not going to kill you, but generally frowned upon by the FCC.
As for mounting an antenna on a box, you'd need a "no ground plane" antenna, or you'd need to make sure the antenna was mounted on a big enough piece of conductive material to provide a suitable ground plane for the antenna. Ground planes are usually 1/4 wavelength (or longer) in each direction from the base of the antenna. At 900MHz, you'd want something a bit below 3 inches. So, mounting the antenna on a metal plate 6 inches square with the antenna in the middle would work. Doesn't need to be steel, could be aluminum foil glued to the box, aluminum window screen, a piece of sheet metal, copper flashing, or even just some wire.
What you'd also need to watch out for is the RF in close proximity to the radio causing issues. A strong RF field around the mic cable, power cable, your computer, other consumer electronics can cause undesired issues. Usually mounting the antenna away from the radio is a good idea.
This is a package I built for our office of emergency services. They provided the oversized Pelican case, it's what they had and what they wanted me to use, I would have used a smaller one if it was up to me. I had a spare 12 volt Motorola power supply and speaker. I installed a 3/4" painted plywood base in the bottom of the case. Radio, power supply, speaker and wire manager are mounted to that. No backup battery on purpose, since it sits in a cache most of the time. When they need it, they can pull it out, plug it in and drop the magnetic mount 800MHz antenna on a file cabinet, vehicle, etc.