I expect it depends on the animal and their historic (as well as personal) exposure to fire.
For example, some Australian raptors understand how fire spreads and how to use it to their advantage pretty well, I'd say! https://blog.nature.org/2018/01/12/australian-firehawk-raptors-intentionally-spread-wildfires/
A 2009 study suggests that chimpanzees understand fairly well how fire spreads and can plan to avoid it https://www.sciencedaily.com/releases/2009/12/091222105312.htm
Forest animals certainly seem to know they need to flee fire.
But like, do dolphins understand fire? Honestly probably not; how would they have developed this knowledge?