Yes UB in live code can have surprising effects, including executing dead code.
I think the main reason for this is an if(testSomeState()) { //code with UB } block being optimized to just //code with UB.
Functions which are unreachable, maybe I agree, they can't be executed (without UB somewhere in reachable code). I'm not sure that's true though - if you have UB in your hardware (not your code), you can still execute that code. This is why (at least I was taught) never to leave dead code around. There's this better thing for that called source control you may have heard of...
IF you have perfect hardware, and IF you have perfect logic/compiler and IF you have no UB in your program, then maybe you can guarantee that dead code is really dead, but I'm not really sure you want to heavily define dead code like that.
Just remove it. Especially if it has UB in it to cause more fun bugs...
¹or is guaranteed to happen in the future
> Right now, we have the fundamental principle that dead code cannot affect program behavior.
Check the footnote at item 14, it links to a page which shows one example of how a line with UB can be reached (basically: the optimizer can reorder the code so that parts of the line with UB will run much earlier than you'd expect).