Is it possible to integrate two-factor authentication (2FA)?

Is it possible to integrate two-factor authentication (2FA) while allowing users to enable or disable the feature themselves?

Thanks in advance