When you double-click on a file icon, the list mapping extension to application is read. If one is found, the app is launched. If the look-up fails, utility file
is run to guess file type based on “magic numbers”. If successful, the first matching app is launched. If everything fails, you get a dialog asking to choose an app manually.
If you try to open a file directly from Writer, the extension plays no role. The file is tentatively opened and its content (or rather a small part at the beginning) is analysed to guess which component should handle the file (Writer, Calc, Impress, …). If the file does not show ODF structure (i.e. does not look like a compressed or uncompressed XML file with the proper DTDs) or other structure readable through the import filters, it is considered as text or binary. “Text” files will be shown “as is” even if you, as a human, immediately see it is HTML or script or whatever.
I am no developer, so I can’t explain the difference of processing between .doc and .html for a pure text containing HTML. IMO, only extension .html makes sense because .doc is a binary format with a well-defined structure.
To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!
In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.