Apex code can create, read, and update (but not delete) custom metadata records, as long as the metadata is subscriber-controlled and visible from within the code’s namespace.
DML operations aren’t allowed on custom metadata in the Partner or Enterprise APIs. With unpackaged metadata, both developer-controlled and subscriber-controlled access behave the same: like subscriber-controlled access.
Professional and Group Edition orgs can create, edit, and delete custom metadata records only from types in installed packages.
Refer:
https://help.salesforce.com/articleView?id=custommetadatatypes_accessing.htm&type=5