As written here https://flaviocopes.com/homebrew-fix-permission-denied-apply2files/ ,
if you had recently deleted Docker, you have to manually recreate the Docker folder:
mkdir -p /Applications/Docker.app/Contents/Resources/cli-plugins
Then run
brew cleanup
You should have fixed the issue!
After that, you can delete the Docker application inside the Application folder