How owerride entity node delete core function
The only way I can think to do this is to override the entity's storage handler in hook_entity_type_alter() with a storage handler that provides the delete functionality you want.

Something like

// You're going to want to be sure you're extending the entity's original
// storage handler.
class CustomStorageHandler extends EntityStorageBase {

  /*
   * {@inheritdoc}
   */
  public function delete(array $entities) {
    array_filter($entities, function ($entity) {
      // Do your logic to determine if the entity should be deleted here.
      // This example only allows entities with odd ids to be deleted.
      return (bool) $entity_id % 2;
    }
    parent::delete($entities)
  } 
}


It is probably a better idea, however, to use the entity's access system to prevent users from deleting entities as it will be confusing to try to delete an entity, then for that to not happen.