If you want a VM for executing untrusted code, use a VM for untrusted code, don't shoehorn it into HTML, or PDF, or whatever. That makes zero sense.
PDF is a special case since there's similarly a considerable value in having things like forms, equations, graphs/illustrations, etc. being interactive but since Adobe has a stranglehold on the format, it was characteristically poorly designed, badly implemented, effectively unsupported, and you had to pay to use it. I would not draw conclusions from this other than avoiding Adobe-encumbered ideas.
The other side of this position is forgetting how important network effects are. People did try to implement purer alternatives but they were always hindered by the need to deploy them first. The low-friction web model is extremely popular with users and any question of replacements or alternatives needs to fit into the gradual upgrade model of the web unless you can get Microsoft and Apple to ship it in the OS.