Yes, WordPress has modal dialog and it is called as Thickbox, but I am not sure how flexible it is to implement what you want to. Here is the code –
<?php add_thickbox(); ?>
<div id="my-content-id" style="display:none;">
<p>
This is my hidden content! It will appear in ThickBox when the link is clicked.
</p>
</div>
<a href="#TB_inline?width=600&height=550&inlineId=my-content-id" class="thickbox">View my inline content!</a>
Refer for more details – https://codex.wordpress.org/Javascript_Reference/ThickBox