Well there are two aspects to this, depending on whether the MX participates in the VLAN or not (i.e. depending on whether it has an IP in it itself).
This picture below shows what the DHCP server settings look like for one of the VLANs I have defined. It will have such a section for each VLAN defined on the MX:
Now for the second aspect, VLANs that are only known on the MS, then the MX won't be present on those VLANs. It can still be DHCP server for those VLANs though. To make that happen you need to tell the MS to forward (Relay DHCP to another server) all DHCP requests towards the MS in Switch > Configure > Layer 3 routing.
On the MX there will be a static route for those VLANs pointing to the MS as next hop. For the subnets that the MX has static routes for, it will also have a section in the DHCP server. It looks very similar:
Regarding your tagging question, basically in the first case the MX will know based on the Addressing & VLANs configurations where to send (which interface) and how to tag the responses for received DHCP requests.
In the second case the response needs to be sent back to the MS, again, based on the Addressing & VLANs section it will tag the response appropriately and send it out the correct interface so it reaches the MS.
More info here:
https://documentation.meraki.com/MS/Layer_3_Switching/Configuring_DHCP_Services_on_the_MX_and_MS
https://documentation.meraki.com/MX/DHCP/DHCP_Services