if we get a temporary internet provider for the new site can we connect the two modems with a VPN?

You'll need some device that can do VPN. This can be two PC's with pfsense installed, or dedicated hardware from e.g. Juniper or Cisco. If you have zero expirience with routers, it's advisable to hire a contractor who knows networking.

will that connection make the pbx work in the second office?

If the PBX uses routable TCP/IP protocols then yes.