There are several related issues swirling around your question. Let me try to disambiguate them and answer them separately:
Can I Retcon?
Yes. You're the GM. It is fundamentally the job of the GM (in D&D 5e) to decide what the players see, sense, and experience about the game world, and it is fundamentally the job of the GM (in D&D 5e) to decide and determine what the world is
I'm unaware of a corresponding passage in the DMG (oddly enough) but the PHB states clearly on page 6:
Ultimately, the Dungeon Master is the authority on the campaign and
its setting...
In D&D, this is nearly absolute, up to the limits of the players getting up and walking out of the game. It includes retcons, even though that is not strictly what that passage is talking about.
Should I Retcon?
This is a dicier question. Strangely enough, this time, it is the DMG putting the brakes on the situation, on page 4:
Consistency is a key to a believable fictional world.
This quote is not really addressing the issue of retcons directly, either. But it is easy to see how this applies-- a retcon, by its very definition (a portmanteau of 'retroactive continuity') is a break in the consistency of the game world you are creating or, in this case, directing.
The thing about retcons is, they can be very jarring for the players who experience them, and individual players and GMs have widely differing tolerances and reactions to them. I've seen players react very badly to even minor changes like this. In the worst cases, it trains them not to trust their senses as you narrate them, and jams their ability to decide what their characters think and feel about their own characters and decision making processes.
But I've also seen players (when they hear me muttering to myself about having messed up my own plan) offer to roll back and retcon a major combat encounter if it would help me out. (I was stunned.)
My best brief answer to the "Should I?" is, with great caution, don't wait very long to do it, and be upfront about it.
Can I/Should I... With Pre-Published Material?
Unless you're in a special situation like running a convention slot or are in some other way subject to an even higher authority than yourself as GM, it does not matter whether you retcon your own personally designed scenario in your own personally designed world, or if you are running something otherwise completely per print from a published adventure.
You're still the GM. You're still the authority. The same caveats about player reactions apply in exactly the same measure.
If an authority for this is needed, the full and complete quote from the PHB is actually:
Ultimately, the Dungeon Master is the authority on the campaign and
its setting, even if the setting is a published world.
(Emphasis mine.)