Jay’s point was not a legal one I suspect. You want to retain the ability to one-click upgrade and redeploy Discourse from scratch. All technical modifications should be plugins or theme components. There is an existing API, SSO, Oauth, webhook support and you always have the discretion to host the Discourse element on a subdomain on the same domain. Use those features to integrate with additional software. Consider the alternative: a nightmare of manually merging in core changes and dealing with bespoke migrations. Nasty, risky and … costly!!!
Plugins allow you to modify the core software extensively and in so many ways. Technically the potential is unlimited. Doing things that way forces you to integrate changes in the right way that results in a more robust and dependable solution that can leverage all the hard work the core team does to the features and integrity of the main app.