yes, but you almost certainly want to do that by creating a plugin (the alternative is that you want to submit changes to Discourse core). See Beginner’s Guide to Creating Discourse Plugins Part 1: Creating a basic plugin. And also I recommend that you start with GitHub - discourse/discourse-plugin-skeleton: Template for Discourse plugins.
But if you see Discourse in your browser, then you can add that skeleton plugin and start making changes there. The other place to look (once you sort of knojw what you’re doing) is discourse/lib/plugin/instance.rb at main · discourse/discourse · GitHub