All packets internal to a switch is associated with a vlan id.
They get the vlan id in one of two ways,
1. when entering on a normal access port, the port is associated with a vlan, default 1, but this can be changed.
2. when entering on a trunk/tagged port the packet arrives with a vlan id.
When packets leave a switch port there is again 2 choices.
1. on a access port, only packets that match the port vlan is allowed out, and the vlan id is stripped and only a plain Ethernet packet leave.
3. on a trunk/tagged port, the packet is transmitted with it's vlan tag (for native vlan it is also stripped)
To answer the question we would have to guess some of the information not provided.
Senario A: both ports on the switch are access port on same vlan.
Tagged packet arrives on VM-in port, and get sent out Router-out port with vlan tag. Possible problems with mtu as vlan tag increase's packet length and for maximum size frames could be dropped.
(Inside the switch the packet will have double vlan tags, but only single original vlan tag when leaving.)
Senario B: Switch is properly configured with trunk ports for VM-in and Router out.
Packets from VM will hit switch with vlan tag, tag preserved in switch and packets out to router will be tagged, router will need vlan sub-interfaces for each vlan to accept packets.