Just increase your time estimate,
calculate in the time needed to refactor,
but don’t tell them you’re gonna refactor.
Works out most of the time.
Only when they ask why the estimate is so long, then you explain your reasoning behind it, and then they might reply with your statement and block your refactoring idea.
However, getting time to refactor most of the time, is aleady way better then never being allowed to do so.



By not accepting your time estimate,
requesting your reasoning why it takes that long, you explaining you calculated time in for refactoring, then rejecting your idea and granting you only time to implement the new thing, without granting time for refactoring.
And dw, my project manager is a pretty chill friend and fellow senior developer, who is reasonable and helps me with calculating in time for refactoring whenever possible/nessecary.
It’s only higher up, CEOs/management, who seek to cut corners, with rocks for brains, who don’t see that in the long run such practices are bad for business.
Which sadly is the case for most IT businesses. But at least in my workplace the project manager is not a rat & on the side of the developers.