I found a paragraph in the documentation on the use of template files in a custom module. This way, you can even use it to override a template like I did here.
However, I wonder if this is the correct way since I have read this response (what does not seem to work with the dynamically generated suggestion).
After some research I noticed that sometimes we can see the use of:
hook_theme_registry_alter
hook_theme
singlehook_theme
withhook_theme_suggestions_HOOK_alter
Apparently there is no clear documentation in this regard.
Is there any difference between adding a template and replacing a template from a custom module?
If so, what is the correct way to add a template and the correct way to cancel a template?