Since you stated that you could use either Photoshop or Sketch, I wanted to mimic
@Danielillo's answer but using Sketch this time.
Disclaimer: The result is far from perfect, I'll just explain the different steps I've taken to almost recreate the Bootstrap logo.
1. Shape
First, we'll insert a rounder corner rectangle into our blank Sketch page using Insert → Shape → Rounded.
Tip: holding alt forces your rectangle to actually be a square.
![enter image description here](https://i.sstatic.net/6JV2I.png)
We can then remove the border of the freshly created square on the right panel (uncheck the border checkbox) and add accentuate the rounded corners on the same panel (I set it to 35 but that was a total guess).
We're also going to rotate the rectangle using the same panel (go with 45°)
![enter image description here](https://i.sstatic.net/qewnh.png)
While our rectangle is still selected, we can select the transform menu Layer → Transform → Transform and manipulate our shape to reflect the skewed Bootstrap logo. Here I have to admit that I just use the logo you provided (dragged and dropped into the Sketch file) as an overlay to reflect its shape. I change the color and the opacity to the new rectangle to make the task easier. There might be a more robust way to do that and if someone has a tip I'd gladly hear it.
Tip: don't forget to specify the order of the elements in the Sketch file using the left panel (just drag and drop the shapes, the Bootstrap logo (png) should be at the end of the list).
![The new rectangle (in orange) and the Bootstrap logo (png) are superimposed](https://i.sstatic.net/bpR7Y.png)
2. Stack
In the next step we are going to duplicate (cmd + D) the rectangle two times and position those two new rectangles thanks to the PNG that currently lives under our vectorial drawing.
![enter image description here](https://i.sstatic.net/WSPwl.png)
3. Colors and shadows
The gradient used in the Bootstrap logo will be replicated thanks to the eyedropper tool. Select the top rectangle and change the color to a linear gradient. The two colors used for the gradient can be selected by clicking the left and right dots in the slider below the gradient type option (see picture).
![enter image description here](https://i.sstatic.net/jTbOv.png)
We are going to click the slider's left dot (the starting color of the gradient) and click the eyedropper to select the top color of the Bootstrap logo's first layer. The same steps are applied to the ending color of the gradient with the corresponding color.
We need to play a little bit the gradient colors and apply those to the three rectangles of our stack.
We can also add a shadow (gray shadow, opacity at 50%) and position it a little bit under every rectangle (y=6, again, a complete guess).
Here are the settings for the almost finished stack:
![enter image description here](https://i.sstatic.net/ui1YT.png)
4. B letter
Last step, the B letter.
Simply insert a text (Insert → Text) and add a capital B with the Verdana font and the Regular font weight (font-size will depend on the size of the previously created shapes).
We then convert the letter to outlines (the text layer will be converted to a vector shape) using Layer → Convert to Outlines so we can transform it and give it the skewed styled from the Bootstrap logo.
Use the steps described in first section of this post to Transform the newly created converted text and place it in the middle of the top rectangle.
And here we are:
![enter image description here](https://i.sstatic.net/ChKWe.png)
It's far from perfect (colors aren't accurate, shapes are not the exact same ones and the letter is not perfectly skewed but... it's a start I guess).