I would like to create an application which sends notifications to my other Apple devices. For example, I enter the text of the notification on iPhone, and my Mac (which has this same application installed) receives it.
Is it possible to do it without such third-party services as Firebase?
Yes. There are various push notification services. Apple's operating systems include first-party support for push notifications (the Apple Push Notification Service, or APNS), as does Microsoft Windows, as does Android. There are also web push notifications, which use a notification service decided by the browser developer (e.g. Mozilla autopush) and may require a browser process to be running in the background.
The basic process is similar for all of them: you ask for permission, and assuming it is granted, are provided with some kind of endpoint URL and tokens or encryption keys to use to send notifications.
Firebase abstracts over those notification services and offers other features which make them easier to work with.
This forum is likely not the best place to learn how to use any of those notification services, however. There is lots of documentation and tutorials available on the web, and I would suggest checking those out.