can a food chain have a quaternary consumer without having secondary or tertiary consumer

Yes, but almost never. Typically predators so far up the food chain have specialized diets that aren't really open to changing. Consider a lion going after field mice when all the antelope die out. This isn't a 1:1, but the principle is the same. As for the animals that eat both primary and tertiary consumers, wouldn't they simply become the secondary consumer if all of their tertiary consumer prey dies out? The nature of the hierarchy necessitates that all the spots going up the chain are occupied. If they aren't, everyone just moves down a step.

thank you

No, a food chain cannot have a quaternary consumer without having secondary or tertiary consumers. Let me explain why.

In a food chain, energy is transferred from one organism to another as they eat each other. Producers, such as plants, are at the base of the food chain and convert sunlight into food energy through photosynthesis. The herbivores, or primary consumers, then feed on the producers. Afterward, carnivores or omnivores, known as secondary consumers, feed on the herbivores.

Similarly, there may be tertiary consumers, which are carnivores/omnivores that feed on other carnivores. These tertiary consumers can be seen as the top predators in the food chain.

Now, a quaternary consumer is an organism that feeds on tertiary consumers. Since the quaternary consumer is one step higher than the tertiary consumers, it implies that there must be secondary and tertiary consumers already present in the food chain. Without the secondary and tertiary consumers, there would be no organisms for the quaternary consumer to feed on, and the chain would not continue.

Hence, a food chain must have primary consumers (herbivores), secondary consumers (carnivores/omnivores feeding on the herbivores), and tertiary consumers (carnivores/omnivores feeding on other carnivores/omnivores) before a quaternary consumer can exist.