Is it possible for two or more physical machines to be "grouped" into one virtual machine such that the CPU cores are shared?
Yes, and no.
What you're talking about is not virtualization though, it's physical machine clustering. It can be accomplished with specialized software, hardware, and interconnects. Check out ScaleMP if you're interested in this. Ultimately, pooling hardware resources like this approaches the same sort of design of how supercomputers are made.
Virtualization machine clusters can be helpful to distribute workloads across many physical machines to solve singular workloads (think MapReduce).
Did that come close to what you were looking for?
Instead of lashing hosts together yourself, look to buy a scale up server.
Single systems running 4 or 8 CPU sockets are available. Much more than that is possible but gets closer to exotic custom clusters.
There are per VM vCPU and vRAM limits, but these days those tend to be quite large.
(And be thankful if your software is not licensed per core.)