Yes, you can. If it is mounted correctly and in a well-ventilated area (within 1 meter from any possible sources of babies food), there is no reason to be alarmed for safety.
One should attach the monitor to a flat surface rather than the wall so that they ensure that the baby doesn't get close to an air outlet or opening (which could result in choking). The location of these openings near where one would mount a camera might make such activities very dangerous, which leads most people to then mount their monitors on the walls instead. This is not recommended as this would create potential problems with fire hazards, moist conditions, or anything else that might come about due to lack of ventilation.