Can a computer be connected to a domain and a workgroup at the same time?

Depends on what you mean by connected and if you also mean on separate networks. You can have a PC on a domain gain access to resources in a workgroup and vice versa by specifying the shared rerources user and password authentication and putting in what shares, printers, etc.. you are trying to access.

For separate networks, you'd need two network cards to set up a multi-homing systems. You can't have a PC that is trully "joined" to both a domain and a workgroup.