So Horsham to Denmark Hill return (via Gatwick) costs me £32 (I travel early morning). However if I select my ticket to go via Dorking it halves the price. Could I select via Dorking and then travel via Gatwick or is that leaving me open to a hefty fine? I don't know much about "rail rules"
There are three routes of fares available from Horsham for Denmark Hill - from most to least expensive these are "+Any Permitted", "+not Gatwick Express" and "not via London".
None of these fare routes require you to travel via Dorking - it may just be that if you want to avoid London for the "not via London" fare, the quickest route happens to be via Dorking.
You can travel via Gatwick Airport on any of the above fares, so long as you observe the other restrictions shown under the route (e.g. not travelling via London Terminals like Victoria or London Bridge if you buy the "not via London" fare).
If you do accidentally travel on the "wrong" route, legally speaking you only owe the difference in fare to the "correct" fare, and can't be issued with a Penalty Fare or fine of any kind. Sometimes, train companies wrongly penalise passengers under these circumstances - if this ever happens to you, feel free to post about it on the forum and we can advise you further.