Let's take the example of a table row that is highlighted on mouse hover.
As mentioned by Sooraj MV, WCAG enforces a contrast ratio of 4.5:1 minimum for AA level of accessibility.
OK but you can argue that the color contrast is good when not hovering / focusing the element.
The problem is that some people with low vision will use a screen magnifier, and for example to read the table row, their mouse will necessarily be on hover. That means everytime they will read a row, they will trigger the hover interaction, making a good color contrast becomes mandatory in this case.
For the contrast of a focused element, the problem seems less obvious, but users generally focus on an element (i.e. button) just before they trigger the interaction. If they can't read what is focused, how are they supposed to know what the action is? They would need to go back and forth. Obviously this is not a good user experience.
Remember that accessibility guidelines are here to help you design accessible websites. In the end, the only thing that tells if it is accessible or not is a user test.
And you can provide a very bad user exeprience while respecting WCAG AA ...
Prioritize user feedback over guidelines