That's alright, in the open source world it is normal for someone to fork an open source project and build on top of it or modify it (MySQL & MariaDB, OwnCloud & NextCloud) , however, when you use a code that is written by others, you must keep the copyrights/license of the original developer and not change it to your own, and only put your own copyrights/license to the files/code you wrote , e.g:
- NextCloud which is a fork of OwnCloud,(server/apps/dav/lib/CalDAV/Plugin.php) : https://github.com/nextcloud/server/blob/6a75296ccbd37d11f88f1e69cfe4063a802c438c/apps/dav/lib/CalDAV/Plugin.php
- OwnCloud's File (core/apps/dav/lib/CalDAV/Plugin.php): https://github.com/owncloud/core/blob/master/apps/dav/lib/CalDAV/Plugin.php