This is possible whenever there's an authentication server involved and the client doesn't validate the authentication server's certificate (or the user manually accepts such a certificate).
However, this is not possible on pre-shared key WPA2-PSK networks, because in IEEE 802.11i four-way handshake both the AP and the client prove to each other knowing the key without disclosing it. The username and the password are not revealed during the WPA2 authentication, but during the 802.1x authentication.
Because WPA2-PSK has other problems (everyone who knows the PSK is able to decrypt traffic of all other users), WPA2-Enterprise with validation of the authentication server's certificate is recommended.