Did some more digging and it looks like the templates plugin creates the dialogue using a registered command, I don't know if one plugin can access another's commands (I assume they can since it's all done through the same joplin.commands class) but they can defintely be executed internally without needing to be associated with a button or anything...