All vmkernel ports used for vMotion MUST be on the same layer 2 broadcast domain and subnet (i.e. VLAN).
That said, it should work but it's not supported by VMware. If you run a production environment, you should still adhere to this.
You supply very sparse info to deduce anything, but I suspect you are running into routing issues here. Use the vmking and traceroute utilities from the ESXi shell to check connectivity between vMotion vmkernel ports.
VMware only started to support routed vMotion with the release of ESXi 6.
See this article for more info: