Setting VLAN ID on modem or on router

I have VDSL connection. My modem(TP-Link TD-W9970) lets me to add VLAN Id when turning on bridge mode. Should I set the VLAN ID on modem or on router. What is the advantages or disadvantages of these settings.

No need for vlan if the router gets a public IP and everything works in bridge mode.
If it does not then set vlan on modem and set vlan on router.

I will setup router tomorrow. I have learned that I have to set vlan id for this ISP. Should I set vlan on both modem and router. Isn’t enough set vlan for only one device?

If the modem passed the internet to you within a vlan then you need to set the vlan also on the router in most cases.
There is no harm to set the vlan in the router.

/interface vlan
add interface=etherY name=vlan-WAN vlan-id=XXXXX
/ip dhcp client
add interface=vlan-WAN

I have to connect with pppoe How can I configure vlan for pppoe?

/interface vlan
add interface=ether1 name=vlan2 vlan-id=2

/interface pppoe-client
add add-default-route=yes disabled=no interface=vlan2 name=pppoe-out1 user=username@whatever

OR you can add the VLAN in the VDSL Modem and then you don’t need the VLAN on the Mikrotik

What are the differences between vlan on modem or vlan on Mikrotik. Are there any advantages vlan on modem?

I don’t think it makes much difference.
Put the VLAN in the modem and you don’t have to see it in the mikrotik, but if you replace the modem you need to remember to put it in the new modem.
OR
Put the VLAN on the mikrotik, and then if you swap the modem you don’t have to remember to re-do the VLAN setting.

It makes no difference from a performance perspective, just personal preference. I have done it both ways over the years, though I lean towards the VLAN on the mikrotik.

Do whatever makes you happy.