That's exactly what CalDAV servers allow. The easiest to set up is probably Baikal, but Radicale/NextCloud are also good options.
The built-in iOS/macOS Reminders.app supports CalDAV for calendars and tasks. Everything is available offline, you can add/edit/delete events and tasks, and it will sync back to the server when you are online again.
This is what Vikunja should allow, but sadly their CalDAV implementation is broken.