If I go all-in preflop with less than the big blind, I'm I entitled to the preflop pot or just double my stake?
Firstly, if you are shoving pre for less than one big blind, you can't win the pot preflop uncontested without having to see a board and go to showdown. The only exception would be if everyone else folded preflop (including the BB, who can run the board with you without investing any additional money and so always should). The other edge case is where you are in the BB yourself and you're all-in blind to pay a portion of the big blind. If this portion is larger than a small blind, then it is also possible for you to win preflop by everyone else folding (and you would win just the SB amount, plus get your original <1BB stack back).
That aside, if you are all-in for less than the current bet (including your example when shoving preflop with <1BB), a side pot will be built as you can only win amounts from the pot where other players have matched your bet.
For example, let's say you are in a tournament where the blinds are 2k/4k (no antes for simplicity) and you are on the button with 3k, it folds to you and you shove.
Scenario 1: SB folds. BB player will be refunded 1k from his 4k BB and you will then see a board with a pot of 8k (your 3k, the BB player's 3k and the 2k from the SB)
Scenario 2: SB completes to 4k, BB checks. Main pot (which you are able to win) will be 9k (your 3k, plus 3k each from the SB and BB) and there will be a side pot between the SB and BB for an additional 2k (the amount by which they collectively exceeded your all-in) going to the flop.
Scenario 3: SB raises to 20k (or any amount really), BB folds. SB will immediately win 1k from the BB player's BB, will be refunded all of his/her raise except for 3k (so in this example 17k) and you will see a board with a pot of 9k (your 3k, 3k of the BB and the SB's 3k).
The same logic is applied if the SB raises and is called, or some combination of raising and folding happens between the SB and BB players. Ultimately you will end up contesting a 9k pot if the SB doesn't fold, or an 8k pot if they do, regardless of what other action there is.
If there are more than 2 other players contesting the pot, you can win an additional 3k for each one which at least calls the BB and the side pot(s) will be built accordingly. So as an extreme example, if you're at a 10-handed table and everyone limps pre (except you, who undershoves for your 3k), you would have a main pot of 30k (including your own 3k) which you could win.