A detached garage or garden building can host panels under the same permitted development rules as the house. The catch is usually the cable run, not the planning.
In England, permitted development covers solar PV on any building within the curtilage of a house or block of flats. On a pitched roof the panels must not stand more than 0.2 metres proud of the slope or rise above the ridge; on a flat roof they must not rise more than 0.6 metres above the highest point. Listed properties and scheduled monuments are excluded.