It can be installed behind the dash as long as you have sufficient airflow to help dissipate the heat coming from the amp. You could always add a fan or two to help draw air across the amp.
It can be done, I agree with the above posts. I wouldn't recommend it as there are several stealth options for mounting an amp. What type of car and how big is the amp? Airflow and cooling are big factors.
Do you already have an amp? If you're looking to hide it then I recommend a full-range class D amp for their small size and relatively low heat output.