I was just looking for a way to do this in order to remove formatting that came with content I copied and pasted. (It turns out there is a button next to text and background color that clears formatting.) As a result I know that some code will copy over automatically when you copy and paste.
If that does not do it, there is an insert media button that accepts an embed code. I tried that with something really simple, and that failed, but depending on what you are trying to add, through html, that might do it for you.
As a last resort you can create the quiz question in classic quizzes, migrate it to a new quiz, and then use an item bank to transfer the question into the quiz you are working on.
You might also want to comment in an idea conversation about this feature: https://community.canvaslms.com/t5/Idea-Conversations/New-Quizzes-Add-HTML/idi-p/399988