J/A 1 -  Yes this position can be reached legally - see Part B below.

Part A:
Let's determine who made the last move through the process of elimination:

1.  First note that the White King was the last piece to enter the logjam on the 1st thru 4th ranks, since all the other pieces in that entire sector are blocked by it.
2.  Furthermore, note that all the pieces must've made their way into the logjam before the e7xf6 capture, otherwise the White King couldn't have made it to the f4 square.
3.  Therefore Black's h8 Rook needed to escape via h6 at some earlier point, eliminating h5 as the last move.
4.  Since the White King was sent to the f4 square at the same time the Black's f8 Bishop was freed by the e7xf6 capture, and since the Bishop still needed to get to a7, the White King couldn't have made the final move.

The only remaining possibilities are White's Knight, White's Pawn on a3, or Black's dark-squared Bishop.
5.  Since the White King is a sitting duck against any Bishop checks on the h2-b8 diagonal, the White Knight must have blocked checks for two successive moves as the Bishop moved through c7 and b8 on its way to the a7 square.
6.  The only way the Knight could've blocked for two moves in a row is if White played the temporizing move a2-a3 as the Bishop moved to b8, so the pawn move is eliminated.
7.  With only the Knight and Bishop as candidates, the only way to reach the final position is:

...          Bc7+
Nd6      Bb8
a3        Ba7
Ne8*      Bb8+
Nc7        Ba7

* or Nb5

So, in the diagrammed position, it must be White's move.

Part B:
Finding a sequence of moves to reach the diagrammed position:

The theoretical minimum number of moves required to reach the diagrammed position is 39, limited by the longer distance required for Black to move his pieces to the other side of the board.
At minimum, Black needs to make the following moves:

King:                7  (Via c7)
Queen :                3  (Via c7)
Rook1:                6  (The one ending up on d2)
Rook2:                4  (The one ending up on e3)
Knight1:                4
Knight2:                4
Bishop1:        7 (From Part A above, we know it must've moved 7 times, as follows, f8-e7-d8-c7-b8-a7-b8-a7)
Bishop2:        0
Pawns:                4 (a7xb6, c7-c6, e7xf6, and h7-h5)

My best was 40 moves (one extra King move for Black).  I don't believe 39 is possible, since the perfect King path isn't available..
White                Black
  1. e4                h5
  2. d3                Rh6
  3. Be3                Rf6
  4. Bb6                axb6
  5. Qg4                Nc6
  6. Nf3                Nd4
  7. Ne5                Rf3
  8. Kd2                Re3
  9. Kc3                Re2
10. Kc4                Rd2
11. Nc3                Nf3
12. Be2                Ra5
13. Rhf1                Ng1
14. Qh4                c6
15. Ng6                Rf5
16. Rae1        Rf3
17. Bd1                Re3
18. Nh8                Qc7
19. Re2                Qg3
20. f4                Qe1
21. Rf3                Nh6
22. Qf2                Nf5
23. Ng6                Ng3
24. Ne5                Nf1
25. Kd4                Kd8
26. g3                Kc7
27. Nb1                Kd6
28. Nc4+        Ke6
29. f5+                Kf6
30. Nc3                Kg5
31. Ke5                Kg4
32. Nd5                Kh3
33. Nf6                exf6+
34. Kf4                Be7
35. Nd6                Bd8
36. Ne8                Bc7+
37. Nd6                Bb8
38. a3                Ba7
39. Ne8                Bb8+
40. Nc7                Ba7