I've been able to play one-shots (read: first sessions) fairly well with only two players.
There's one part of character creation that's a little out of balance when there's only one other PC - writing bonds. Here's what I usually say about that:
So I realize there are all these bonds to write and exactly one other PC to do it with. Don't just put their name in everything. Pick as many as you want to apply -- at least one, and no more than half your total bonds (round down).
This keeps the total bonus to the Aid or Interfere move generally in line with the bonus a PC in a larger group gets when they're looking to roll +bond with their best friend, and when there's only one other PC they're your best friend by default.
That'll get you through a solid single session, but the game's more than single sessions. At least it sounds like you want your game to be more than that.
However, I haven't seen campaigns sustain themselves very well with only two protagonist characters.
Arranging the entire world against two protagonists for a longer period of time can result in some of your GM moves coming a little off-kilter. Separate them is always the strongest possible version, separate everyone. There's a smaller aggregate health pool to deal damage to, and similarly a smaller load of resources when you want to use up their resources. Give an opportunity that fits a class's abilities has never exactly meant "a class that's currently in the party", but "we pursue the opportunity in a ramshackle fashion" is a story beat that's kind of hard to keep fresh, and it's similarly hard to keep a story fresh if you try to limit yourself to opportunities for just two slices of the fantasy pie.
What's to be done?
Players can run multiple characters. However, this isn't something I would recommend springing on novice players. It's an option generally presented to characters who have already reached 10th level, to take an apprentice and play them instead, with their mentor still around to take part in the story -- but somebody who's taken a character to 10th level has a lot of experience using the system already, so keeping two characters' worth of opportunities in their heads is easier for them than it would be for a novice.
You can provide hirelings. While you the GM play the hirelings, the same as the rest of the world, you have a much freer hand to align the hirelings with the characters' interests - well, as long as they're being paid and treated well. Hirelings often offer lesser but less risky versions of following up on opportunities that outside classes could capitalize on. With the aid of hirelings, the party can kind of track like The Ranger, kind of deal with traps like The Thief, kind of recover like The Cleric, kind of give and take hits like The Paladin or The Fighter.
Here's a little rules hack you might want to make use of in this case.
You can write hirelings into your otherwise empty bond slots. When you Order Hirelings you can mark an unmarked bond of yours with them to take +1 to the roll, at most once.
At the end of session, if all your bond slots with someone other than the other PC are marked, you can mark XP, clear all your marks, and work with the GM to rewrite and update any bonds that have changed.
You can provide Crew. This might not be the best option for a first-time GM. Crew are part of an alternate setting for Dungeon World that unfortunately never saw commercial release; however, I've detailed the important parts of them in this answer (which, ironically enough, is about running the game for a large and volatile group). Crew generally provide more solid story-facing benefits than a hireling would, but they're riskier to make use of and require more judgement on the GM's part to run.
And again, here's a little hack you might want to drop in as well.
You can write Crew into your otherwise empty bond slots. When you get your Crew's Benefits you can mark an unmarked bond of yours with them instead of paying 1-loyalty.
At the end of session, if all your bond slots with someone other than the other PC are marked, you can mark XP, clear all your marks, and work with the GM to rewrite and update any bonds that have changed.