AFAIK 802.1Q tag is optional in the FRame header. So it may or not be present in the header right? SO how does the Packet processing ASIC or processor identifies or parses to interpret the frame header as vlan tag present or not present ?
With 802.1q payload in the packet unique ethertype value is used in the header of Ethernet frame. Normal IPv4 packets use 0x0800, normal IPv6 packets use 0x86DD, 802.1q packets use 0x8100 etc.