To add to NautArch's answer, the answer to your question is yes - Colossus Slayer does work with opportunity attacks - but there are some interesting edge cases where you can do the extra damage from Colossus Slayer three (or more) times in a round.
So the problem is that Colossus Slayer is limited per turn. So if you attack and hit once in your turn you can't any more activation in that turn (short of wish shenanigans). As per the correct answer you can get a second activation during another characters turn via attack of opportunity (or via a Battle Master fighter's Commander's Strike maneuver). But an extra 2d8 per round doesn't really feel like it's going to kill a colossus, does it?
The easiest and stupidest way to get more damage out of Colossus Slayer is to be a multiclassed level 17 Wizard / level 3 Ranger and use time stop to get multiple turns in one round. Unfortunately, if you have a level 20 character and do this, then the god of action economy will appear in real life and smite you.
But there is an Unearthed Arcana fighting style called Tunnel Fighter (from UA: Light, Dark, Underdark!), which can trigger the extra damage from Colossus Slayer many, many more times in a single round without incurring divine intervention (emphasis mine):
You excel at defending narrow passages, doorways, and other tight
spaces. As a bonus action, you can enter a defensive stance that lasts
until the start of your next turn. While in your defensive stance, you
can make opportunity attacks without using your reaction, and you can
use your reaction to make a melee attack against a creature that moves
more than 5 feet while within your reach.
With this, you can get more than two Colossus Slayer strikes per round if you can get multiple enemies to provoke opportunity attacks. Great. Now all we need is a bunch of enemies to provoke opportunity attacks from our ranger.
Strictly speaking, depending on party size, campaign level, preparation and DM willingness you could potentially have vast arrays of enemies leaving your reach and provoking opportunity attacks in one round via feats, spells, class abilities, glyphs of warding, and many, many other exploits. Ultimately, you could force dozens of enemies into the range of our Tunnel Fighter ranger to get dozens of extra 1d8 damage.