It works exactly the same way in macOS Finder as in Windows Explorer. Extensions are hidden by default. You can enable to show extensions (either by individual file, or globally). If a file has it's extension shown, you will get a confirmation prompt warning you of the consequences by changing the file extension.