Yes, it is very possible to lose a war, even though characters can't be permanently killed. Wars in high-sec and low-sec are somewhat different than in null-sec (0.0), so I'm assuming you're talking about 0.0 here as that's what the original post was about.
Unlike high-sec and low-sec, player organizations can establish sovereignty in 0.0 when they have met certain conditions. To start claiming or contesting sovereignty the organization must build control towers. Only alliances can make sovereignty claims, corporations can't do it on their own.
There are different levels of sovereignty in EVE, each of which takes time and resources. And this isn't just for show, either, as sovereignty brings tangible benefits that can be a huge advantage in combat. It brings bonuses to the efficiency of towers, allows for the anchoring of capital ship building facilities, and most importantly, it allows the anchoring of jump bridges. Jump bridges are similar to the gates found in each system which is the system used by ships to move from one system to another, but jump bridges can bypass several systems and allow travel very quickly from one side of the alliance's space to the other. Best of all, jump bridges only work for members of the alliance, so no one else can use them. Obviously, the ability to move around like this is a massive advantage in combat, as it allows the defender to move great distances and bring large fleets into battle very rapidly. Sovereignty level 4 brings even more benefits, and you can read more about that
here.
Needless to say, EVE's sovereignty system makes it a major undertaking to attack an established alliance, but it can be done. Jump bridge and POS passwords can be compromised by spies, which gives an attacker a number of ways to disrupt the defender. Stations can be camped by fleets equipped with warp disruptor bubbles, sometimes trapping entire fleets inside a station.
Owning sovereignty in 0.0 allows alliances to mine precious resources and make a lot of ISK (sometimes massive amounts of ISK!), and this money is needed to fund operations and buy ships. Prolonged wars can grind down both sides, eroding their ability to replace destroyed ships and offer incentives to members. If one side loses most of its capital fleet during the course of the war, the enemy may eventually be able to destroy the capital ship building facilities, and the defender may gradually lose the ability to fight major fleet engagements.
Usually when things reach this point it's only a matter of time until the defender collapses and the situation starts to rapidly deteriorate as individual members start to jump ship or move all their personal assets to a safe place in empire. An alliance that has been through many wars and has veteran leadership is going to be much harder to deal with than an untested one.
So yes, it is possible to crush an established alliance and win a war, but it takes a combination of planning, deception, and raw firepower to pull it off. Alliances can burn up a lot of ISK in futile invasions if things go badly. But when things go well, it can set off a whole chain of events that can shift the balance of power in EVE.