Cannot boot after adding a command in rc.local

Is there any way, similar to the adb shell can directly access the file system, I want to delete the command

Have you tried using serial console? Even if GUI and local login fails, sometimes serial console still has access. Otherwise it might be a case of cloning, editing the clone, and flashing the edited clone.