It dependsTM
I'm going to cover the general setting lore, along with some specific links to Forgotten Realms lore in the footer. We don't have a 5e Greyhawk setting book yet so I'm relying on the general lore from the DMG for this (though the upcoming Mordenkainen's Multiverse book may provide some 5e specifics for that setting).
In general souls are free to return
From the Dungeon Masters Guide: Magic in Your World > Bringing Back the Dead section we have most of the information required to answer both parts of your question:
When a creature dies, its soul departs its body, leaves the Material Plane, travels through the Astral Plane, and goes to abide on the plane where the creature’s deity resides. If the creature didn’t worship a deity, its soul departs to the plane corresponding to its alignment. Bringing someone back from the dead means retrieving the soul from that plane and returning it to its body.
Enemies can take steps to make it more difficult for a character to be returned from the dead. Keeping the body prevents others from using raise dead or resurrection to restore the slain character to life.
A soul can’t be returned to life if it doesn’t wish to be. A soul knows the name, alignment, and patron deity (if any) of the character attempting to revive it and might refuse to return on that basis. [...] If the evil cleric wants to revive Sturm to interrogate him, she needs to find some way to trick his soul, such as duping a good cleric into raising him and then capturing him once he is alive again.
So for most creatures, in most settings1, they go to either the plane where their deity resides or the plane corresponding to their alignment.
It also gives us a constraint, separate to the specific spell based constraints, the soul must be willing to come back, and they know who is attempting the raising. As you've mentioned, most of the resurrection spells contain the additional constraint that the soul must be free.
So, the soul must be free, and willing to be raised. No restriction is provided here on souls in the afterlife, so they are by default free to be raised unless there are specific rules for a plane that prevent this. This means that on most planes where the souls reside they will be free, but they may not be willing (though that's more a question for the specific soul). Even if the specific spell being used doesn't mention that the soul must be willing, unless it specifically says that it can raise unwilling souls, the restriction from the DMG still applies (so no death-torture loops).
Nine Hells/Hell specific exception
For the Nine Hells specifically, we have more specific information (from Mordenkainen's Tome of Foes):
Devils constantly strive to recruit mortals into their ranks by offering them rewards in return for their service. [...] When a cultist dies, its soul emerges in the Nine Hells and becomes another of the Blood War’s immortal soldiers. Most of the evil souls consigned to an afterlife in the Nine Hells become lemures, which make up the vast majority of the hellish forces, but some mortal recruits who willingly accept a contract offer from a powerful devil can arrive as a lesser devil.
So a creature condemned to the Nine Hells, is no longer a "free soul", it's soul is enclosed within a new creature, either a lemure, or a lesser devil (depending on the method of their arrival there). As they are in a creature shell, they no longer satisfy the condition of being dead...they are alive, just in a different body2 on a different plane. Specifically they are now a devil.
The Hades exception
The Dungeon Masters Guide section on Hades specifies:
[...] Hades is the destination of many souls that are unclaimed by the gods of the Upper Planes or the fiendish rulers of the Lower Planes. These souls become larvae and spend eternity in this place that lacks a sun, a moon, stars, or seasons.
Creatures that die on Hades are also transformed:
Optional Rule: Vile Transformation
[...] If the creature reaches six levels of exhaustion, it doesn't die. Instead, the creature is permanently transforms into a larva, whereupon all levels of exhaustion afflicting the creature are removed. [...]
Hades is crawling with larvae. Night hags, liches, and rakshasas harvest them for use in vile rituals. Other fiends like to feed on them.
The Wish exception
Wish as a spell enables mortals to do things that they would not normally be able to do as wish states:
You might be able to achieve something beyond the scope of the above examples. State your wish to the DM as precisely as possible. The DM has great latitude in ruling what occurs in such an instance, the greater the wish, the greater the likelihood that something goes wrong. This spell might simply fail, the effect you desire might only be partly achieved, or you might suffer some unforeseen consequence as a result of how you worded the wish.
Additionally, a number of features in the game call out wish specifically as being one of the only things that can resolve a situation. For example the Narzugon from MToF (thanks to Groody The Hobgoblin for the example), when attacking with it's Hellfire Lance, can do:
If this damage kills a creature, the creature's soul rises from the River Styx as a lemure in Avernus in ld4 hours. If the creature isn't revived before then, only a wish spell or killing the lemure and casting true resurrection on the creature's original body can restore it to life. Constructs and devils are immune to this effect.
So, for creatures turned into lemures by the Narzugon, a wish spell is one of the potential routes to restore them to their former life. It should be noted that this entry doesn't provide a specific exception for all lemures, just for those transformed by the Narzugon.
The Carceri exception
If for some reason, the soul were to be transported to Carceri, then they are restrained by the plane itself. The plane has the feature:
Optional Rule: Prison Plane
No one can leave Carceri easily. Magical efforts to leave the plane by any spell other than a wish simply fail. [...]
So restoration magic cannot get souls trapped on Carceri.
Godly/DM exception
Given the power invested in the gods, they would certainly be able to restrain a soul from being raised from the dead (should they wish to). In previous editions this was given explicit mechanical effect, but in 5e, it's left up to the DM.
Destroying the soul exception
It is possible, in 5e, to destroy the soul. Once a soul is destroyed nothing short of divine intervention can restore the soul (in most cases). In some cases, the destroyed soul is beyond even the power of a deity to restore.
So where do souls go?
Souls go, in order:
- If the soul is destroyed...then nowhere, it's gone, don't collect €200, go directly to jail
- To the Nine Hells if they are bound by an infernal contract, where they are assigned into the body of a devil (either a lemure or a lesser devil)
- The plane of the deity they worship (if any)
- The plane related to their alignment (see the list in the Player's Handbook which splits the outer planes by alignment)
- Hades if they are otherwise unclaimed (and then transformed into a larva)
Are they free to be raised?
In most planes, yes, unless a god has restrained a specific soul, or some other being on that plane has done so.
For the Nine Hells specifically, there have been measures put in place to restrain every soul attributed to the Hells (namely housing damned souls in lemures or other devils). As a result, if the soul has been condemned there, it is not free, by virtue of already having a body in the Nine Hells.
For Hades, a similar restriction applies, as the soul is transformed into a creature, the larva.
If they are on Carceri, they cannot leave (short of wish). The plane itself is the restraint.
In some cases, wish might be able to bypass this restraint, but barring a specific exception provided in the rules, that will be down to the DM and their specific setting.
Why do I assert that lemures and larvae are no longer "free" once they are transformed?
All of the resurrection spells specify that the creature must be dead. By virtue of them being a new creature that is alive they are no longer dead. Thus they lose the primary criteria for being resurrected by one of these spells. Larvae certainly fulfil the criteria of being alive (and they aren't listed as being undead or any other category of creature that is no alive), as do lemures.
Are they willing?
That depends on the specific soul. But for a soul dedicated to a deity, like a cleric, they may not want to leave the plane of their deity for any reason (short of being commanded to by said deity), and thus be unwilling to leave.
1: The Forgotten Realms has two specific modifications to this, covered by these two questions:
- General FR lore for souls of the dead
- Souls of the unaligned in FR
2: The lemure also has this specific restriction on dying permanently, which provides a specific exception to the "killing devils permanently in the Nine Hells" rule:
Hellish Rejuvination: a lemure that dies in the Nine Hells comes back to life with all it's hit points in 1d10 days unless it is killed by a good-aligned creature with a bless spell cast on that creature or it's remains are sprinkled with holy water.
This does provide a potential out for the lemure...if the raiser can find the specific lemure in the Nine Hells, kill it and either attempt to raise it while the lemure is dead, or ensure that it's remains are sprinkled with Holy Water, freeing the soul, and then raising it from the dead with it's original body...though this may be particularly difficult and a worthy quest in and of itself.