I would not recommend investing in the iOS Notes ecosystem. There is no way to export these notes with their metadata and media intact without using iCloud. If you need a note-taking app, go with Joplin instead; it supports Markdown, has both iOS and desktop clients, and supports self-hosted syncing.
You can connect iOS Notes with any IMAP server. This supports a reduced feature set (no embedded images, tables, or audio) but does allow for self-hosting.
Embedded files (photos, video, audio, PDFs, etc.) and bullet hierarchies were the two things that I remember being the most trouble; you can copy bullet hierarchies from iOS Notes and paste them into another app, but they aren’t detected when copying the note via Shortcuts. Embedded files had to be manually saved. I think you could Airdrop notes to a MacOS device, but it would wipe the date created metadata from what I remember.