Of course she can. She is the only person in the realm with the authority to do so.
You're maybe conflating peerages with royal styles and titles. Peerages require an act of parliament to 'strip' someone but not HRH/prince/ss
When it comes to royal styles, 'The Queen can giveth and The Queen can taketh away'
What some have been discussing is if Harry for whatever reason didn't seek/get permission to marry and marries anyway. Would there be some sort of 'punishment' for lack of better word.
By statute he would be excluded from the line of succession but titles are the prerogative of the sovereign.
Although a different set of circumstances, Edward VIII's abdication made him in the words of Geoffrey Ellis 'A Private citizen of the crown, who by implication has also lost the right to style himself H.R.H.'
Would Harry's exclusion from the line of succession be viewed as him becoming a 'private citizen of the crown and therefore not entitled to style himself HRH'
Ultimately it would be up to the Queen (or Charles) to decide.
In any case, even if the Queen could strip Harry of his royal title, the relevant point is that new LPs would still be needed. What I and other posters were arguing is that the Succession to the Crown Act 2017 says nothing about royal titles and, similarly, the Letters Patent 1917 say nothing about succession rights. If Harry married without consent, the only legal effect under the Succession to the Crown Act would be that he and hs descendants wouldn't have succession rights, but his HRH status as a grandson of a sovereign in male line and the HRH status of his children (for the same reason when Charles became king) would be preserved under the LPs 1917, which have not been repealed by the Succession to the Crown Act
Putting it in another way, HRH status in the UK is not legally tied to succession rights as it is for example in the Netherlands. In fact, there are hundreds of people in the line of succession to the British throne, but only 14 of them are currently HRHs, meaning that being in the line of succession is not a sufficient condition to be an HRH. Conversely, there were people in the past who were not in the line of succession, but were HRHs nonetheless in their own right (for example, the Duke of Windsor and Prince Michael of Kent), meaning that being in the line of succession is not a necessary condition either to be an HRH in the UK.