How can I can I add functionality to my module so that the templates can be overwritten?
You need to declare your templates by implementing hook_theme(), and when needing them in your module uses a render array rendered with the RendererInterface::render() method on the renderer service.

Theme, or other modules, will then be able to declare override for your templates like they do for any others.

The theme system overview in Drupal documentation gives more details on this process.