Hello there,
Yes, you can use them even with the different IP addresses.
For the failover cluster, If the server does not have a network adapter that is configured to use DHCP, you must configure one or more static IP addresses for the failover cluster.
A distributed network name uses the IP addresses of the member servers instead of requiring a dedicated IP address for the cluster. By default, Windows uses a distributed network name if it detects that you're creating the cluster in Azure (so you don't have to create an internal load balancer for the cluster), or a normal static or IP address if you're running on-premises.
More information here https://learn.microsoft.com/en-us/windows-server/failover-clustering/create-failover-cluster
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer–