I try to avoid it when I can to minimize hypothetical problems, but often I just prefer mounting the amps elsewhere (example, I like them better on a board behind me rear seat, than behind or on top of my box). I never had any issues with smaller setups when I would mount amps to the box. Was quick, easy, and amps came out with the box when I needed to remove it. I’ve seen tons of installs like this over the years, really hard to say with any certainty, but seldom any dire issues from it. I keep in mind that, yes it could add additional vibration, which could in fact be bad for electronics, however, might be hard to prove one way or another for a given setup / amp.
Let’s be real though, a ton of amps blow up that have never been mounted to a box, tons of amps, not limited to any brands either.
There is a lot of vibration throughout the vehicle, so it could be an issue even remotely mounting the amp. Not including driving vibration which can also be pretty rough in some vehicles, even rear view mirrors are 100% useless with bass running, my side mirrors as well, so if another panel(s) is vibrating / and or oscillating, you could still have heavy vibration elsewhere. I use to do a ton of amp repair, and not sure I ever had anywhere you could say it was box mounting that killed them. If you see heatsink mounted components legs busted / fatigued, that can indicate excessive flexing of things internally, but that's sometimes more of a design problem than box mounting it. I'll say it isn't something I stress over, and if the need arises to mount an amp to a box in future setups of mine, I will do so without much worry.