Yes, you can disable it if you have shell access.
https://docs.nextcloud.com/server/16/admin_manual/configuration_server/occ_command.html?highlight=occ#two-factor-auth-label