Hello @YusukeYamashita-6797,
Yes, if your tenant has an Azure AD Premium P1 or P2 license, you will be able to use the API to retrieve MFA information for your users. It is not necessary to assign these licenses to individual users in order to use the API. However, keep in mind that certain features of Azure AD Premium, such as MFA and self-service password reset, may not be available to users unless they are assigned an Azure AD Premium P1 or P2 license.
As for the second part of your question, if you are able to retrieve MFA information for all users in your tenant without assigning licenses to them, this may be due to the fact that the API is returning information about the MFA status of all users in your tenant, regardless of whether they have been assigned a license or not. However, this could also be due to a misconfiguration in your tenant or a bug in the API. It's always a good idea to double-check the documentation and test thoroughly to ensure that you are getting the expected results.
Good luck!