Can I generate own certificate for testing locally?

No, it is not possible to use self-made/unverified certificates to connect to the mTLS token endpoint. Only valid certificate can be used in production environment.