It would be theoretically be possible for you to install Discourse in such a manner however I would not recommend it as there are multiple hard coded paths in the code where the software depends upon Discourse code being installed in /var/discourse. This could easily be solved by running a fork though however you may fall behind with updates.
Disclaimer: I am speaking for myself only and not on behalf of the people who develop the software. If you are a member of the Discourse team feel free to clarify or rebuff my point if needed.