If you run your own Mastodon server, you can add custom emoji by logging into the website through your admin account and then going to:
Preferences > Administration > Custom Emoji
When you first log in, you'll see a long list of all the custom emoji that are visible to your server, including your own server's emoji and those that are on other servers you federate with.
To just see your own emoji, click the "Local" tab at the top, to just see other servers' emoji click "Remote".
To add your own emoji, click "Upload", Emoji can be PNG or GIF files up to 50kb, and they can be still or animated. Remember to add a shortcode that describes what it looks like, and uses CamelCase or underscores so that screen readers can distinguish the words.
To clone emoji from other servers you federate with, tick the box next to the emoji you want and click "Copy".
To block an emoji from another server, tick the box next to it and click "Disable".