Can sunpanel be mounted to horizontal 2x4?
You can secure a Panel by any means necessary. The reason they should be mounted by a back board or vertical stud is to make sure you have the ability to run circuits to the Panel with as little interference as possible.
Just something to think about while you are in the planning stage. Good luck.