We know that the packet contains an IPv4 header, by reading the EtherType field. My question is, how does the NIC know the Layer 2 protocol is Ethernet to begin with? If there are two different Layer 2 protocols in the channel, how do you know which one you are dealing with?
A NIC is built for Ethernet. Or Fibre Channel. Or Wi-Fi. Or Bluetooth. Or (formerly) either FDDI, ATM, or ARCNET.
I don't think there's ever been a multi-protocol NIC outside a lab.
(Recently though, some storage NICs have become bi-lingual, Ethernet or Fibre Channel, depending on the SFP module fitted).
On the channel, you've only ever got a single L2 protocol. There's no way multiple protocols can coexist.
I think this is mentioned in Ethertype field of Ethernet Frame: https://en.wikipedia.org/wiki/EtherType