The money a country spends in defense is usually really high. There are many countries in a world like ours where the army is hardly ever used. Could it be possible for a country that is surrounded by allies to drop its army and use the money for something else? Would their allies see this as an opportunity for invasion and find any excuse to attack? Would it automatically trigger a coup?
From Ally to Freeloader
One immediate problem a country would have from dropping its army is that it is now a big fat freeloader. An army is expensive, so immediately the allies could ask - why should we be paying all the cost of defense and allow you to enjoy the benefits? The well-armed countries could move for trade sanctions, demand payment from the country to help pay the cost, or just generally insist on bigger benefits on all future deals and treaties to help cover the cost of defense.
Humans also have a funny tendency to be willing to join others in punishing someone who has violated norms like reciprocity, people who want to take advantage. Psychologically it wouldn't take much for all the allies to join together to make the undefended country suffer - financially or otherwise - to "even the score".
This has happened and is actually a part of NATO agreements, and there a number of Polandball comics like this:
This doesn't necessarily mean revolution, but it could easily become more costly than actually having an army if your allies want to push the issue.
Who's Going To Stop Us?
There is an old saying, along the lines of "one honest gun keeps two in the holster", or more famously: "Speak softly and carry a big stick." One reason that countries don't use their army is precisely because they have one, or simply the deterrent effect.
Also note that, while you mention a scenario with no outside threats (assuming alliances hold strong), note that armies are often used as an internal deterrent against revolution from within. If you don't have a military, then martial law isn't exactly an option, and this lack of opposition could make rebel forces quite dangerous (if you have any).
Finally, note that history has long recorded that few countries have allies forever. England and France were allies in the world wars, for instance - yet there were many hundreds of years where they were bitter enemies. Alliances tend to last precisely as long as both countries involved find them useful, and no longer.
They say you never need a gun until the moment you do. The same can be said about armies. governments don't really need them in good times, but when it's people began to revolt or another country decides to invade then suddenly the country needs an army, but army take time to build and time to train that way most country through out history have found it safer to have an army already available in crises situation instead of try to train an entire new army from scratch. At the very least they will a small group of elite warriors at the read backed up by local militia army that can be formed to support them if need.
Also something to consider sometimes disbanding an army can be more expensive then keeping one. If a large military of hundreds of thousands suddenly disbands then that s couple hundred thousand people that are suddenly unemployed. While some military jobs can build marketable skill that can be used out of the military. This is why are government put some much money in to paying for the education of ex vents, so that they can be reintegrate into society. Do this on gigantic scale could be very expensive.
A country without a military has a large number of problems, as other answers already described.
In many cases the outcome might be bad (or at least bad for those people or groups that are currently in power in that country)
All kinds of threats from the outside can be countered with enough military. But there is also a different way: Don't be a target.
Admittedly, in most cases that also means: don't have anything worth taking. Most of all no oil or such.
So, if you have natural ressouces, you need to find a way to make sure you can keep at least enough of them to support your population. Still, that, too, can be handled without an army, especially if you remember that there is always a bigger fish.
But then there are threats from the inside.
An army can be used to impose martial law. This is alwasy some kind of "lender of last resort" in any country where the government managed to screw up so badly that large parts of the population can no longer be kept peaceful by just threatening them with laws.
Such a government might either do the wise thing: remember what their job actually is, and improve the situation of the people. Or send the military to beat the hell out of protesters.
So, what does that all mean:
Unless you have nothing left to lose, you would need a really good government to be able to afford not having a military.
The answer will have to be "it depends". I'll speak of NATO since it's the most obvious example, assuming when you say "average country" you mean "average developed nation". The alliance requires members having a mutual investment in collective defence - if one party is attacked we all come to their defence, and we can't very well do that without a standing army.
However, there are exceptions. Iceland hasn't had an army for yonks, and doesn't want to have one. Of course they aren't "average", but that term is pretty amorphous right now. Iceland however wanted in NATO. Problem is NATO requires one to have an army, the compromise was that Iceland would provide NATO with bases instead of troops. In the above link it details other military commitments Iceland provides, like radar bases it maintains. So it's possible to be armyless and still to contribute.
It's worth noting that NATO recommends (requires?) a 2% of GDP defence spending, which is really not very much at all. Armies also have utility to help in a crisis like a natural disaster, so they're not completely useless in peace time.
It would probably be possible for say, a country like Portugal or Britain or France to do away with their armies because they are not in immediate threat, surrounded by allies, and in a stable political situation. Their nearest rivals also simply don't have the logistical capability to invade and hold their territory. But a country like Finland, Estonia, Latvia, Lithuania, or Poland, with direct land border with historic rivals who are becoming more aggressive in recent years (see Ukraine), needs a military. They also need allies because they are too small to survive on their own.
And while it would be risky for Russia's western-focused neighbours to decommission their armies, it would be downright suicidal for others like Israel, Taiwan, South Korea, whose militaries protect them from very real threats. If South Korea gave up its arms today and kicked out their US allies, you can bet North Korea will unify the peninsula tomorrow (in fairness the opposite is also true, though a better outcome).
Life outside of a military alliance however is riskier, and for example; countries in the Middle East usually spend a lot of money on defence (Saudi Arabia spends a whopping 13.7% of GDP on their military and America in comparison spends 3.3%), because they are surrounded by threats, both from neighbouring states and internal strife. Then again, perhaps a Latin American state could do away with its army and not have to worry too much, so long as they had a sufficient police and border force to handle any issues. Again, it depends on context.
Let's see what happened in Europe in 1940. While the Dutch, Danes, Belgians, and Luxembourg had some armed forces, they were woefully inadequate, underfunded, and very poorly equipped.
Other countries (Germany in this case) who were on paper friendly to them saw this as a golden opportunity to do a bit of expansion of their territory, gain new workers for their industry, and new raw materials as well.
And yes, these countries were not in any way hostile to Germany, non-agression agreements were in effect that had stood for something like 50 years in case of the Netherland, Denmark, and Germany.
There was a lot of trade, exchange of arts and science, etc. etc.
No reason to believe the same wouldn't happen in other places.
Supplementary answer about a special case, an Island Nation
Such a nation may not need much of an army to stay secure. What army it has, is to deal with internal security, and it might well go by a different name.
What it needs is a good navy and air force, and (in the modern world) excellent shore to ship missile defences.
It's then pretty much invasion-proof. If it maintains a policy of strict neutrality and provided it is not blocking any major sea route or global resource, it will be left alone. 15 miles of water kept the UK safe in WW2. (That was a close thing). 150 miles of water would have been 100 times safer, rather than 10.
New Zealand is the closest real world example I can think of. (About 1000 miles of water? And Oz is another island nation).
Switzerland, being land-locked, needs and maintains a good army, but it is very different to most other ciuntries' armies. Switzerland also follows the policy of neutrality, and geographically it is far easier to move armies around Switzerland rather than through. The Swiss army is trained for guerilla warfare in alpine terrain, should any other army ever invade. The alpine passes are death traps for any invader.
Costa Rica abolished its military in 1948. It seems to have worked out fairly well for them.
Most nations need a military to defend them from foreign militaries.
But they also face a threat that their own military will take over the government in a coup and run the place for themselves.
There have been around 296 coups and coup attempts since 1945, which I believe is considerably more than the number of foreign wars. Of course, you might lose more in a foreign war.
2% of GNP is nothing to sneeze at, either. If you can put an extra 2% into development each year, if you can grow your economy 2% faster, in 35 years your GNP will double compared to what it would be otherwise. But if you get a coup and a junta puts a lot of your resources into their offshore bank accounts, you might lose far more than 2%.
It's a question of relative risks. And it depends a lot on your neighbors. Particularly if you have border disputes and reasons they can use as an excuse to attack, that's an issue. They can always make up reasons later. But a lot of the excuses they can make up, depend on you having a military. They can't argue you're a threat to them if you don't have one.
The devil is in the details.
Attempting to not retread too much ground here, a simple side effect of disbanding one's army would be internal problems. Not even so much as a rebellion but the relative flexibility an army can provide. Engineering units can prove to be very useful economically as well as during disasters where a dam or bridge needs fixing, as well as a national guard/reserve can help during evacuations or searches for lost people. Amphibious assault ships have come to the aid of sinking civilian vessels, and a carrier i believe, to some extent, during hurricane Katrina. You also have the political value of joining the army and the nationalism, etc.