Reactions are actions that you take out of turn (or possibly on your turn) that happen in response to something else. A reaction can never occur without a trigger.
A Ready action is a special type of action that uses your action to prepare for a triggering event, and when that event occurs you use your reaction to perform whatever you had readied.
To step back a moment, you have four "action types" you can make:
- Action
- Bonus Action
- Reaction
- Movement
On each round, you get one of each of these things. On your turn, you can use an action, a bonus action (if some class feature, feat, spell, or some other thing grants you one), and you can move up to your movement speed (if you use the Dash action you also move as your action). You also get a free "interact with an object" (does not include magic item activation/use). Whenever a triggering event for a reaction occurs, you can also use your reaction. Anything that requires a reaction will tell you what the triggering event is, except in the case of a Ready action, where you actually determine the triggering event yourself.
A Ready action uses an action on your turn to, as I mentioned previously, prepare for some triggered event which then uses your reaction to perform. So when you Ready you might say, "I Ready my firebolt cantrip to cast at the first orc that steps through that doorway."
This uses your action for that turn. Then, when the triggering event occurs, you can do as you have described, using your reaction to complete the Ready action, OR you have the option to move up to your movement you instead (irrespective of if you moved or not on your turn).
So, in essence, a Ready action uses both the action and reaction granted for that combat round, and once your Ready action has triggered you cannot act again until your next turn.
One other note for readying spells -- when you Ready a spell you actually cast the spell using your regular turn action, and "hold" it until the triggering event occurs. Note that this usage requires concentration. You can cast the spell as long as you continue concentrating on holding it.
It is important to note also that because you only get one reaction per combat round that if you have taken an Opportunity Attack or cast a spell with a casting time of reaction (such as Shield) then you cannot use your reaction to complete your ready action (but you might still have movement remaining). On the other hand, if you have taken the Ready action and your trigger has occurred and thus you've used your reaction for that round, then you cannot cast a reaction spell or take any Opportunity Attacks (barring any special abilities/feats that might grant additional OA's).
Your rogue can absolutely attack (action), disengage/dash/etc. (bonus action from Rogue Cunning Action) and Uncanny Dodge (reaction) on a single turn, but he can only Uncanny Dodge in reaction to a triggering event (outlined in the rules for Uncanny Dodge).
What Surprise Means
Surprise is a judgement call on the DM's part that is situational.
The DM determines who might be surprised. If neither side tries to be stealthy, they automatically notice each other. Otherwise, the DM compares the Dexterity (Stealth) checks of anyone hiding with the passive Wisdom (Perception) score of each creature on the opposing side. Any character or monster that doesn't notice a threat is surprised at the start of the encounter.
Readied Action
Readied action uses the reaction for the same round that the action was readied. If every party member readies an action for the door to break down, and the door doesn't get broken down that round, the action is wasted. They can re-ready the same action the next turn. In that case, when the trigger happens, they all take their action (in initiative order (or [Dex] order) since they all have the same trigger) and the DM resolves them.
If a surprise round were to occur without the trigger being able to fire, the readied action is lost and the players will take normal actions on their next turn. I don't think that's how this should play out.
How I'd Rule
In the situation you describe, the players are alert because they are kicking down a door, so they expect something to be on the other side. They have even readied actions to take, so the ogres can't really get the jump on them -- the players aren't surprised.
The ogres would have been surprised if the party successfully beat the door down, but they failed the roll and the ogres heard the sound. They know that something is trying to come through the door -- the ogres are not surprised.
Readied actions will happen on triggers as usual (or not if trigger doesn't come, or if reaction is used to do something else like Opportunity Attack), as no one is surprised.
The three scenarios
RAW, there shouldn't have been a perception check. The players took no action that would give them one. That said, as a DM you can give them that extra heads up...
The Players' turns (and thus reactions) would be lost during the first round if the ogres surprised the players. Second round they'd act as normal. That is what surprise does. Otherwise, it is legal.
If everyone is surprised, no one can act for the first round. That's 6 seconds of everyone looking at each other in shock. No actions taken. Otherwise, it's legal.
It's legal.
Best Answer
It depends how you consider the game world to work
Dodging ends at the start of your turn, if the NPC immediately takes the dodge action, has any time passed between one dodge and the other? In my opinion the NPC never stopped dodging. Even if they did, I'm not convinced there is any perceivable way to notice if someone is ready to dodge or not.
The second problem I have with this trigger is that triggers when dodging ends. The rules for readying an action state:
Turns don't exist to PCs, so it's hard to imagine that dodge ending when the NPCs turn comes around is something that can be observed.
Overall I find that trigger too technical, and doesn't really take into account the way the game world is functioning. I don't see any other way to make the ready action work here, without DM fiat (more on that later).
I would ask for what the player is looking for, what they expect their PC to be reacting to. If they give some mechanical answer about turns or actions, then that's a good sign that their trigger isn't legal.
What other options did the player have?
One simple way to counter dodging is to grapple the target. A grappled target's speed is 0, which means they can't benefit from dodging. Since it uses a grapple check instead of an attack roll, they don't have advantage from dodge.
Similarly you could use shove to push them prone, in which case dodge's advantage is countered by advantage when attacking prone targets from 5ft.
Another option is to get out of sight. Depending on the situation this may he easier or harder. If you can break line of sight (or hide) then dodge doesn't give advantage against attacks.
Dodge back. Clearly the NPC likes dodging, perhaps by dodging back they will be forced to change tactics or that will be enough to earn their respect.
As a DM you may allow some clever reactions. For example perhaps readying an action for when the Bladesinger attacks. Even though the PC may be hit too, the Bladesinger has to commit in order to attack, so as a DM it may be a fair ruling to say that the Bladesinger isn't dodging while attacking. Waiting for other distractions or setting a trap for the Bladesinger may be acceptable to you too, but all of this is just DM fiat.