user1793: This question concerns the opening. For example, in the Danish gambit:
[FEN ""]
1. e4 e5 2. d4 exd4 3. c3 dxc3 4. Bc4 cxb2 5. Bxb2

white reaches the desired position. But what happens if the opponent deviates from this move order? Would it still be the Danish gambit? Can I still follow the moves in the Danish gambit or do I have to use other moves? Does an opening variation involve any alternative moves?

user1824: Following an opening doesn't mean just follow the lines but follow the concepts and strategies behind that and after each move track tactical possibilities. Opening lines are guidelines to find the best analyzed move but you should always know the opponent on the other side can play something else deliberately or not. After that in many cases you can take the chance to get some advantages (also it's really hard when the opponent is better than you).
For example in your selected line, after 1. e4 e5 2. d4 exd4 3. c3 if black doesn't take your pawn 3. ... dxc3 and plays 3. ... Nc6
r1bqkbnr/pppp1ppp/2n5/8/3PP3/8/PP3PPP/RNBQKBNR w KQkq - 0 4

You should obey the principles and occupy the center by 4. cxd4 and it's a good advantage. (However this gambit is not good because opponent can simply develop his pieces if he knows good responses)

user2001: The opening is the first 10-20 moves of a chess game. The move order is critical. In an opening system, you aim to reach a certain position after the opening phase is completed. This position can be reached using different move orders. You will have to adjust your individual moves in order to reach the desired position.

user291: Other answers have made good points about how to react when opponents make unexpected moves in the opening, but I wanted to specifically address one part of your question because it is a common issue, but has been internalized so much by experienced players that they forget that it isn't obvious.
Chess openings are defined by both players' moves, not just your own. The Danish Gambit, as you say, is defined by the moves 1.e4 e5 2.d4 exd4 3.c3, not just by the moves 1.e4, 2.d4, and 3.c3. If Black plays 1...e6, for example, there is no way to reach the Danish Gambit.
To answer your specific questions:

But what happens if the opponent deviates from this move order? 

Then you have to find the best move to deal with the different position on the board.

Would it still be the Danish gambit?

No.

Can I still follow the moves in the Danish gambit or do I have to use other moves?

It's possible that any given chess move could be useful in another position (for example, 2.d4 is a fine move after 1.e4 e6 just as it is after 1.e4 e5), but you have to evaluate based on its merits in the actual position. Blindly following a sequence of your moves and ignoring what your opponent does is a recipe for disaster.

Does an opening variation involve any alternative moves?

Sure. For example, the Danish Gambit is defined by 1.e4 e5 2.d4 exd4 3.c3. Black might decline to take the pawn and play something like 3...d5; it is still called the Danish Gambit, but the gambit has been declined. Or after Black does take the pawn with 3...dxc3, White could take it with 4.Nxc3 or offer a second pawn with 4.Bc4; these are both different branches of the Danish Gambit.

user1856: You never "have" to follow an opening sequence, especially just for the sake of following an opening name. There's nothing special about the "Danish Gambit"; it's just a group of moves someone decided to give a name. Any sequence of moves can be given a name if people really wanted.  If your opponent plays a different move order or unexpected move you should adjust your play accordingly. But of course there's always a chance you might transpose back into that "Danish Gambit" line depending on what moves are played.

1793: <p>This question concerns the opening. For example, in the Danish gambit:</p>

<pre><code>[FEN ""]
1. e4 e5 2. d4 exd4 3. c3 dxc3 4. Bc4 cxb2 5. Bxb2
</code></pre>

<p>white reaches the desired position. But what happens if the opponent deviates from this move order? Would it still be the Danish gambit? Can I still follow the moves in the Danish gambit or do I have to use other moves? Does an opening variation involve any alternative moves?</p>
 1824: <p>Following an opening doesn't mean just follow the lines but follow the concepts and strategies behind that and after each move track tactical possibilities. Opening lines are guidelines to find the best analyzed move but you should always know the opponent on the other side can play something else deliberately or not. After that in many cases you can take the chance to get some advantages (also it's really hard when the opponent is better than you).</p>

<p>For example in your selected line, after <code>1. e4 e5 2. d4 exd4 3. c3</code> if black doesn't take your pawn <code>3. ... dxc3</code> and plays <code>3. ... Nc6</code></p>

<pre><code>r1bqkbnr/pppp1ppp/2n5/8/3PP3/8/PP3PPP/RNBQKBNR w KQkq - 0 4
</code></pre>

<p>You should obey the principles and occupy the center by <code>4. cxd4</code> and it's a good advantage. (However this gambit is not good because opponent can simply develop his pieces if he knows good responses)</p>
 2001: <p>The opening is the first 10-20 moves of a chess game. The move order is critical. In an opening system, you aim to reach a certain position after the opening phase is completed. This position can be reached using different move orders. You will have to adjust your individual moves in order to reach the desired position.</p>
 291: <p>Other answers have made good points about how to react when opponents make unexpected moves in the opening, but I wanted to specifically address one part of your question because it is a common issue, but has been internalized so much by experienced players that they forget that it isn't obvious.</p>

<p><strong>Chess openings are defined by <em>both</em> players' moves, not just your own.</strong> The Danish Gambit, as you say, is defined by the moves 1.e4 e5 2.d4 exd4 3.c3, <em>not</em> just by the moves 1.e4, 2.d4, and 3.c3. If Black plays 1...e6, for example, there is no way to reach the Danish Gambit.</p>

<p>To answer your specific questions:</p>

<blockquote>
  <p>But what happens if the opponent deviates from this move order? </p>
</blockquote>

<p>Then you have to find the best move to deal with the different position on the board.</p>

<blockquote>
  <p>Would it still be the Danish gambit?</p>
</blockquote>

<p>No.</p>

<blockquote>
  <p>Can I still follow the moves in the Danish gambit or do I have to use other moves?</p>
</blockquote>

<p>It's possible that any given chess move could be useful in another position (for example, 2.d4 is a fine move after 1.e4 e6 just as it is after 1.e4 e5), but you have to evaluate based on its merits in the actual position. Blindly following a sequence of your moves and ignoring what your opponent does is a recipe for disaster.</p>

<blockquote>
  <p>Does an opening variation involve any alternative moves?</p>
</blockquote>

<p>Sure. For example, the Danish Gambit is defined by 1.e4 e5 2.d4 exd4 3.c3. Black might decline to take the pawn and play something like 3...d5; it is still called the Danish Gambit, but the gambit has been declined. Or after Black does take the pawn with 3...dxc3, White could take it with 4.Nxc3 or offer a second pawn with 4.Bc4; these are both different branches of the Danish Gambit.</p>
 1856: <p>You never "have" to follow an opening sequence, especially just for the sake of following an opening name. There's nothing special about the "Danish Gambit"; it's just a group of moves someone decided to give a name. Any sequence of moves can be given a name if people really wanted.  If your opponent plays a different move order or unexpected move you should adjust your play accordingly. But of course there's always a chance you might transpose back into that "Danish Gambit" line depending on what moves are played.</p>
