(a) Yes. The first law says that energy can be neither created nor destroyed, only changed from one form to another. In an ecosystem, no energy is created: the producers convert the sun's radiant energy into chemical energy in food, and consumers pass it on. At every step some of it changes into heat, but the total is not lost from the universe. So the one-way flow sun → producers → consumers → heat is fully in keeping with the first law.
(b) NCERT: ecosystems "are not exempt from the Second Law of thermodynamics. They need a constant supply of energy to synthesise the molecules they require, to counteract the universal tendency toward increasing disorderliness." The energy the forest captured in the past has already been used and lost as heat, which cannot be used again. So the forest needs fresh energy from the sun all the time to go on making its molecules.
