The 2 space extension is generally regarded as very hard to cut and thus solid, providing at least 1 eye with various options to gain a lot more eyespace easily.
However, invasions and attacks are still possible. The B1 move in your diagram is actually a standard invasion with the marked black stone around.
$$cm1 A possible invasion of two-space extension
$$ +---------------------------------------+
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . 1 . . . . Q X . . . . |
$$ | . . . . . B . O . . O . . Q X . . . . |
$$ | . . . , . . . . . , . . . . X , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
Influence
One usual aim of this move is to either create center influence like this:
$$cm1 Influence, part 1
$$ +---------------------------------------+
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . 2 1 . . . . . . . . . . |
$$ | . . . . . B 9 W 3 6 W . . . . . . . . |
$$ | . . . , . . . 5 4 8 . . . . . , . . . |
$$ | . . . . . . . . 7 . . . . . . . . . . |
.
$$Wcm1 Influence, part 2
$$ +---------------------------------------+
$$ | . . . . . . . . 5 . . . . . . . . . . |
$$ | . . . . . . 4 O X 3 . . . . . . . . . |
$$ | . . . . . B X W X O W . . . . . . . . |
$$ | . . . , . . 2 X O O . . . . . , . . . |
$$ | . . . . . . . 1 X . . . . . . . . . . |
(B9 and the atari may be different on certain boards.)
$$Wcm1 Influence, result
$$ +---------------------------------------+
$$ | . . . . . . . . O . . . . . . . . . . |
$$ | . . . . . . X O . O . . . . . . . . . |
$$ | . . . . . B X W . O W . . . . . . . . |
$$ | . . . , . . X X O O . . . . . , . . . |
$$ | . . . . . . . O X . . . . . . . . . . |
This can be good depending on the global situation. Of course, white gets super strong, so black should only consider this if there is no useful attack on the 2 space extension anyway and the center is important.
Base robbing
Another idea is to use this invasion to steal eyespace and gain some territory. It is usual if there is a black stone on either side of the extension.
$$cm1 Base robbing, simple variation
$$ +---------------------------------------+
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . a 1 3 b . . . . . . . . |
$$ | . . . . . B . W 2 4 W . B . . . . . . |
$$ | . . . X . . . . . , . . . . . X . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
A and B are miai to connect the stones out, so black can consider an outside move to attack - or he can firmly link up his 2 stones to either side to rid white of any sente moves near the edge.
This way, white ends up with a solid, but eyeless group with good center access. Depending on the board, this can be good for either player.
$$cm1 Base robbing, white resistance
$$ +---------------------------------------+
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . 2 1 . . . . . . . . . . |
$$ | . . . . . B . W . . W . B . . . . . . |
$$ | . . . X . . . . . , . . . . . X . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
However, white may think about resisting like this. this move can be good, but usually black 1 is only played if black can follow up like this:
$$cm1 Base robbing, black counter
$$ +---------------------------------------+
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . O X . 1 a . . . . . . . |
$$ | . . . . . B . W c b W . B . . . . . . |
$$ | . . . X . . . . . d . . . . . X . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
A and B are miai now, so the black stones are out and white has a weaker shape than by playing C to begin with. In some cases, black plays the B-D exchange before B1.
$$Bcm1 White resistance, another idea
$$ +---------------------------------------+
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . 1 . . . . . . . . . . |
$$ | . . . X 2 . O . . O . X . . X . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . X . . . . . . . . . . . . X . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
Sometimes, white can try a kind-of-sente move instead of replying directly. If black answers the move, white can play more aggressively against the invasion stone. If black follows up the invasion, an exchange could take place. This should be considered carefully before invading at 1.
Depending on the board, white may dislike the invasion on the second line, and thus plays a tobi to strengthen her group:
$$Wcm1 Defend
$$ +---------------------------------------+
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . e . . . . . . d . . . . . . |
$$ | . . . . . B . W . . W . B . . . . . . |
$$ | . . . X . . . . . , . . . . . X . . . |
$$ | . . . . . . . a b c 1 . . . . . . . . |
Any of A, B, C are thinkable just as well, and in some cases a tsuke at D or E is reasonable, too. This requires some reading, as D and E tend to lead to a huge exchange.
By the way, keep in mind that base robbing can be beneficial to white on certain boards. That's one of the reasons white, instead of the second line invasion, an attack at black 1 or a is usual in this shape, too, as well as moves on top of B or C.
Actual game
In the actual game, white had some extra stones to the right, which changes the situation significantly.
$$cm1 Simple answer
$$ +---------------------------------------+
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . 3 1 4 . . . Q X . . . . |
$$ | . . . . . B 5 O 2 . O . . Q X . . . . |
$$ | . . . , . . . . . , . . . . X , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
White could simply answer at W2, connecting firmly. Black cannot play 3 at 4 because then white would play 3 and thanks to the white stones on the right, black dies inside.
Thus black has to connect out, allowing white to get a reasonable shape with the tiger mouth at 4 in sente. Black 5 is played on the third instead of the second line because it has far greater influence on the center and the strength of the white group.
$$cm1 Strong answer
$$ +---------------------------------------+
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . 2 1 . 5 . . Q X . . . . |
$$ | . . . . . B . O . 3 O 6 . Q X . . . . |
$$ | . . . , . . . . . 4 . . . . X , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
White can also consider the strong-hand descend at 2, blocking the connection out. Black will play 3 and 5, to which white avoids the self-destructing reply to the right of 5 and instead simply nobis at 6. Black is now forced to find a way to connect out or live locally - I'll leave the tsumego as an exercise for the reader.
Related joseki shape
$$cm1 Simple answer
$$ +---------------------------------------+
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . 2 1 . . . O . . . |
$$ | . . . . . . . . B . O . . O 3 . X . . |
$$ | . . . , . . . . . , . . . . . X . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . X . . |
In this very common joseki shape white is supposed to have a very solid group with enough eyespace to be difficult to attack. However, with the marked black stone in place, the invasion of B1 is an astonishing threat. The details are too long to list here, but if white blocks at 2, black will play the tesuji of 3 and it is very hard for white to find an answer that doesn't lose half the group, base, and yose.
Answering your further questions
Question 3: How strong is the two-space extension? In the initial situation where black
invades at 1, what is the best white can expect to get?
The 2 space extension is stable. It is not alive locally, it is not strong, but it is stable in the sense of being connected and thus difficult to fiendishly attack. Prefer this extension when you don't like the idea of being split.
$$Wcm1 Solid
$$ +---------------------------------------+
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . X . . . . a 1 b . O . X . . . |
$$ | . . X , . . . . . c . . . . . , X . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . X . . |
$$ | . . . . . . . . . . . . . . . . . . . |
For instance, in this shape, a wide extension to A would immediately be invaded at B. White could think about playing 1 at C, aiming for a light shape, but that offers a range of difficult to handle invasions that you need to be comfortable with.
Also, leep in mind that "killing" is not always the best answer to moves that are either unusual or bad. Sometimes letting the opponent live is the best punishment. Remember the idea of the sacrifice in the 'influence' section of this answer - in that case, maybe just go for center influence (connect instead of block) when the center is of more value.
And contrarily, you'll be astonished how much dan players hate living sometimes. I remember a high dan friend of mind talking about a game he played against a pro: "I lived everywhere by crawling on the second line. It was atrocious, I could not find a good way to die."
Question 4: I found myself at quite a lack of knowledge when it comes to defending
such non-standard attacks, however, most resources (like SL) only cover the
typical attacks. Is it worthwhile to invest a lot of time into learning how to deal
with strange attacks? Or should one expect to get this simply by experience?
Midgame joseki as those presented in this answer are very useful. Either learn them by playing tons of games and remembering the best shapes, or look them up in books. I remember there was a pretty thorough discussion of the 2 space extension in "Shape up!" by Charles Matthews. Eventually, as a dan player, you'll be forced to remember them from study though since (at least Western) books rarely cover deep variations for specific boards or new inventions.