- We'll do almost anything for our beloved animals.
The class of NPIs (Negatively-oriented Polarity-sensitive Items) includes the any class of items: any, anybody, any longer, any more (AmE anymore), anyone, anything, anywhere.
And you seem to already understand a bit on how NPIs work, in that NPIs are restricted to non-affirmative contexts (where an affirmative context is a declarative main clause in a positive environment).
But some of the items also have a "free choice sense", and so, they can occur in an affirmative context (where a NPI can't).
Your example of "We'll do almost anything for our beloved animals" seems to be using the "free choice sense" of anything. And that is why your example is grammatical.
Examples and info were borrowed from the 2002 reference grammar by Huddleston and Pullum et al., The Cambridge Grammar of the English Language (CGEL), pages 822-3.