As a creature the goblin has been around since at least 1145 - it is centuries older than Tolkien's Lord of the Rings. If you read this you will note that the hobgoblin is a 'friendly trickster', thus a huge shift from the 5e monster. Going through this list you will find the Redcap mentioned. You may find that the Harry Potter books and movies have a goblin that is closer to myth and lore. In fact you may find goblins get a better treatment in Discworld or even in Xanth. Let us look at the D&D version of them for a moment.
The 5e goblin is not a complex creature. Included in their family are hobgoblins and bugbears - though it is not clear how they are related. Can any of them reproduce? Would a female goblin survive being mated or pregnant with a bugbear? Do the preferred races show up at random like a recessive gene? At this time no book makes this clear.
For special, magical and supernatural abilities: goblins get Nimble Escape to hide & run more easily and bugbears / hobgoblins get extra damage. How to make them memorable and fun?
Something that both the Monster Manual and Volo's Guide make clear: goblins gain little except misery from joining their larger 'kin'. Their gods are destroyed long ago by the hobgoblin's god. Their culture is crushed upon joining, the greatest of goblin leaders are treated as less than the lowest of bugbears or hobgoblins. Goblins are used as cannon fodder against far superior foes such as orcs and gnolls. It is well known that their afterlife reward for such service is an eternity of suffering. The books do not explain why desertion and rebellion are not the norm though it is presumed that these small people are simply too cowardly.
The Monster Manual statistics for an average goblin list average intelligence and high dexterity (14) but low wisdom and charisma (8). In Volo's Guide they adapt easily with magic or Booyahg. Though Volo specifies that goblins 'lack the intelligence' to learn wizardry he also suggests they are often warlocks or sorcerers. It is a weird book. Since Volo points out a page later that goblins can easily learn a spell from an alien spell book at a glance / 'stole a look' and can master somatic and verbal components by aping gestures (mastering this magical training can take decades for other races). Let us assume that, given this information, goblins make great rogues and surprisingly competent wizards.
Keep in mind: most patrons would Zone Of Truth or truth serums or some other means of sussing out motivations before excepting any refugee-rebellious troops. No one trusts goblins - especially not the goblinid.
There are few things more horrible than petty, nasty and cruel creatures getting access to near-infinite power. If a goblin (boss-leader or otherwise) were a rogue they may seek to desert, possibly taking some trusted (?) friends along with him. Such a tiny wizard would have high intelligence and probably low wisdom - possibly the textbook definition of arrogance and hubris. But someone or something would have to spark this avalanche of rebellion. What kinds of creatures would do this?
Later in Volo's Guide it suggests how goblins are not suitable for becoming Illithid - but they do make excellent brain-food. One could imagine a runaway mind flayer Arcanist would not only be sympathetic to goblin plight but be keen to make higher quality harvests. As bugbear brains may be junk food and hobgoblins nigh-impossible to break, such a mind flayer would be keen to have their mini-mages out from under oppression. There would probably be a selection process whereby all the smarter goblins would escape.
This is where things get tricky: would the goblins figure out how to overthrow their new squid-faced oppressor? With such high intelligence and the ability to read minds (especially the ones eaten), wouldn't the aberrant owner of this clan see anything brewing on the horizon? Would such an outcast get lonely and keep certain goblins alive regardless of their track records? Possibly a certain number would be needed to reproduce, to create the ideal crop.
Dragons somehow accumulate kobolds like rats in a grain silo - so goblinid-draconic connections can be rare. That said, dragons will accept any race for a standing army, especially those good at stealing them more treasure. Rebellious goblins are unable to return to their hob-nobbing leaders so they may be more loyal overall.
Green dragons prefer to collect interesting people rather than gold - goblins may count (?). Blue dragons may enjoy collecting sages and wizards. The chaotic dragons may not have the interest nor patience to train up an entire
All 'true' dragons offer the half-dragon template - with a short lifespan, goblins could use the extra
Long lasting meta-patrons could magically evolve goblins into another sub race like drow, duergar or svirfneblin. Such a race would have +2 to +4 racial modifications on intelligence rather than dexterity.
Large warlike, organized groups of humanoids like hobgoblins will easily defeat giants with ranged weapons - especially in 5e D&D. Smart goblins would seek an enemy of their enemy and offer their services. Evil cloud giants may begrudgingly accept terms until the enemy army were destroyed.
Though paranoid, Beholders make intelligent leaders. In a beholder vs. beholder war (especially after a new one is 'birthed' by a dream), the upstart challenger would need magical allies badly. Even a small group of Magic Missile casters can easily turn the tide - AntiMagic Ray can only hit a small area after all.
Goblins live a short life but magic can solve this problem. Potions of Longevity, going to planes where aging does not happen - possibly hiding in a Mirror of Life Trapping or using Rods of Splendour - the list is endless. With a solution a goblin would have the time to devote to building an entire wizarding school.
Sentient magic items could guide students over the decades. A conscious-intelligent spell book or other magic item. . Creative use of Magic Jar or any use of a ghost-spirit of a goblin trapped in any item such as a golem or shield guardian.
What would be most interesting: a civil war between the hobgoblins themselves. An errant hobgoblin war mage would seek to have wizards that they alone could trust - who better than a secret goblin cabal?
The nilbog are ghost-like shred fragments of god-spirit residue, left behind after Maglubiyet (god of hobgoblins) slaughtered all goblin gods. How would rebels target and destroy hobgoblin & bugbear pantheons? Could a group of mages cast enough Dream spells on Kuo-toa to simply re-construct new gods? What would they be like?
To be clear: this entire article is 'what happens if some goblins get a spell book?' Due implications of complicated racial, religious and political tensions result in world-changing consequences. But for fun, try these situations:
This is enough stories. Thanks for reading.