No, but it depends on the DM.
The DM can allow this because it is a dramatic move. But one prone to abuse. Because as long as you have superiority dice and acts before the enemy, you could just move an ally.
The RAW order of actions is:
In your turn, you ready an action to attack the dragon when it uses breath weapon.
In the dragon's turn, it breathes fire. Your friend is toasted.
You atack the dragon and the friend (if it is still alive) moves.
This happens in this order because:
When the trigger occurs, you can either take your reaction right after the trigger finishes or ignore the trigger
boldface text added by me
So you cannot interrupt the dragon's breath. You take your readied action after the trigger happens. Your friend will be roasted.
You must choose an action or movement, but you can omit other information.
Then, you choose the action you will take in response to that trigger, or you choose to move up to your speed in response to it.
As we can see from this sentence, the minimum requirement is to choose an action or movement. I believe "the action" in this context is anything from Actions in Combat which includes:
one of the actions presented here, an action you gained from your class or a special feature, or an action that you improvise. Many monsters have action options of their own in their stat blocks.
When you describe an action not detailed elsewhere in the rules, the GM tells you whether that action is possible and what kind of roll you need to make, if any, to determine success or failure.
So for instance "If X happens, I attack" and "If X happens, I use channel divinity" meet this requirement, whereas "If X happens, I do something" is not specific enough.
The PHB also gives us some examples from which we can make additional inferences:
- If the cultist steps on the trapdoor, I'll pull the lever that opens it
- If the goblin steps next to me, I move away
The first example is very specific.
In fact, there isn't any relevant information that we could add to "I'll pull the lever that opens it" to make the Ready action more specific: we can pull that one lever that opens the trapdoor mentioned in the trigger, and even if other levers were present we wouldn't be allowed to pull them.
The first example also shows us that we can choose an action implicitly, because in this example we chose the Use an Object action without naming it explicitly.
The second example is very vague.
There is plenty of relevant information that is missing from "I move away", such as whether we will walk, swim, or fly, and which path we will take. Therefore, the second example confirms that we can be vague and omit relevant information.
However, even this example is not completely devoid of relevant information, as "away" implies a general direction. This suggests that it's best to include at least some relevant information.
Moreover, eventually we must choose whether to walk, swim, or fly, and which path to take. So if our Ready action is vague we can make decisions during the reaction.
Your example.
You can ready an action for "When the Goblin moves, I Attack" as this meets the minimum requirement for the Ready action.
Because that Ready action omits relevant information, you must make decisions during your reaction, such as who to target with your attack(s) and which weapon to attack with.
In particular, you could choose to attack a Goblin, a Bugbear, or anyone else for that matter. However, you cannot unsheathe a weapon during your reaction because you can only use your free object interaction "during either your move or your action", which means that your choice is limited to the weapon(s) that you are wielding when the Goblin moves.
Best Answer
Yes you can Ready an action you currently cannot do
The rules for Readying say:
Readying doesn't involve doing anything at all at the time that you Ready. All you have to do is choose "the action you will take". Decide a trigger and decide a future action, there are no other requirements other than that.1
Or, as @RyanThompson says in a comment below:
Thus, there is no rules or logical reason why you cannot ready an action "to attack with a sword when a receive it from my ally" or "breath fire once my ally casts dragon's breath on me".
Of course if the thing or ability your action depends on fails to get to you before your next turn you have wasted your action, so this is even riskier than a normal Readied action.
Exception: You cannot Ready a spell you cannot cast
Readying a spell requires you to start casting that spell as part of the Ready action.
If you do not meet the requirement to start casting spells (or that spell in particular) then you cannot Ready a spell. It is good to note that you don't have to choose a target or even have one in range to start casting the spell.
1 - You can describe the Ready mechanic narratively as taking some preparatory action (holding a sword above your head ready to strike, getting into a sprinter position to get ready to move, etc.) in your game, but that is not dictated or even implied by the rules. The rules simply state the mechanics of taking the action and let the DM and players find a narrative that work with it. Following the rules and creating a compelling logical narrative can sometimes be at odds with each other and nothing in the game says that they have to get along all the time. It is up to the DM/table to decide where to draw that line and where and how much to tweak rules they see as crossing it. Regardless, the rules say what they say.