Suppose you have two NICs with the same MAC address, but not necessarily the same IP address. What is the least possible separation (in terms of number of switches, routers, different IP subnets etc.) needed that would still allow traffic between the NICs?
Suppose you have two NICs with the same MAC address, but not necessarily the same IP address.
You can't have that within the same link-layer segment. Identical MAC addresses will disable reliable switching/bridging.
What is the least possible separation (in terms of number of switches, routers, different IP subnets etc.) needed that would still allow traffic between the NICs?
The NICs need to be in different L2 segments - at least one router in between. Also, they would have to be in different IP subnets to enable normal routing. For a router to see identical MAC addresses in different subnets is not normally a problem.
The number of switches in between doesn't matter - each broadcast is propagated throughout the broadcast domain (=L2 segment), so each NIC messes up the source-address table for the other on every participating switch. Of course, both NICs could be in different VLANs since those represent separate segments.
 As has been pointed out by Jörg, the "router" above can very well be an L3 switch that is used as a router. Note that the switching/bridging function of an L3 switch can not cope with identical MACs within the same segment either.
[edit2] Also, (see comments, I thought that was pretty obvious) having multiple NICs with identical MACs is a bad thing. Generally, MACs are supposed to be unique (at least within a site's scope) in order to avoid problems that may be hard to diagnose.
If need be (thx Ron!) you need to separate those NICs into their own broadcast domains/L2 segments/ESXi port groups and use a router to enable IP communication between them. Make sure your router or L3 switch is fine with duplicate MACs across its L3 interfaces. Do not replace the router without prior testing. Running that router inside a VM might have its own tribulations.
Disclaimer: I have no experience running something like that in an ESXi environment - since a vSwitch works somewhat differently from a hardware switch - it has considerably more insight - there may be unexpected problems (unless you distribute the VMs to different hosts). In any case, duplicate MACs will likely require the "MAC address changes" option on the port group. They might even require running separate vSwitches in addition to using separate port groups.
Zac has put a great answer together. But I wanted to add a simplified answer along the same lines.
Identical MAC, not within a single layer 2/broadcast domain.
There are probably a lot of devices out there with the same MAC address, but because the minimum required separation is at this very low level it doesn't cause issues.
Another consideration to keep in mind, there might be some systems that rely on MAC address for identification/tracking, and for this reason I'd hope to never have this issue within a single area of a corporate network.
Zero separation is possible. TLDR Yes you can do it in plain ehternet where there is no any restriction applied.
If communication between VMs is based on IP protocol there will be no issue. Even if it plain L2 protocol there is no issue also if protocol can differentiate communication node not only by MAC address(for example IP protocol).
Because ARP (address resolution protocol) is based not only on Layer 2 address scheme(MAC address) but additionally on IP address scheme. That is why in local network we can have MIM attack (man in the middle attack) then someboby is mocking not only yours MAC address but IP address also and can intercept all on you local traffic. This type of attack can be mitigate by security policy on ethernet switches say by applying some type of policy on eth-port where there can be only one(Hello Duncan McLeod %) ) unique MAC address per ethernet port possible.