As with the answers to many questions, the answer to this one depends on the definition of the key term. It hinges on how we understand what it means to be an ally. For some people, to be an ally requires only expressing the right feelings of sympathy. For others, it is much more serious. It requires never giving the slightest bit of help to an oppressor, which is a serious problem when almost anyone can be part of one of many oppressor classes.
Some people think that it’s not possible to be an ally to all people at all times, and I can offer an example that might help illustrate why that would at least be very difficult to do. Let’s suppose that you want to be an ally to people of color and also to poor rural white folks who are struggling with addiction and depression. And let’s suppose that a part of what we mean by “being an ally” is that one needs to never give aid and comfort to the oppressors of an oppressed or marginalized group. If there is even a small percentage of those poor rural white folks struggling with addiction and depression who are also racists who discriminate against people of color, and you’re trying to be a good ally to their group because of struggles with poverty and mental illness, it’s likely that you would end up giving aid and comfort to those racists. Probably not intentionally, but it would happen because of your support for that group.
Another possibility is that the interests of marginalized groups just happen to conflict sometimes, and if being an ally means supporting their interests, then it won’t be possible to be an ally to all groups. For example, you might want to advocate the idea that sexual identities are innate and based on genetics because that supports the interest of the same-sex couples who want to be able to have a legally recognized partnership. You also might want to advocate the idea that sexual identities can be determined by the individual even when their genetics and general physiology indicate that their sex is different than their self-identification, because that supports the interest of transgender persons to modify their bodies to match their self-identifications. These ideas are at the very least in significant tension, and advocating one might well harm your advocacy of the other.
In these kinds of situations, it’s unavoidable that you would fail in your duties as an ally to at least one group to which you were honestly trying to be an ally. Which leaves us with an interesting set of questions. Is it possible to be an ally to every marginalized or oppressed group? And if so, what does it mean to be an ally in the first place?