No, not always. Learning game programming in a 3D environment is now more accessible than ever thanks to game technologies like Unity 3D. Nearly all of the high school kids I’ve taught the fundamentals of game design/development using Unity have been successful.
However, if you’re considering a career in game development, having 2D knowledge will be beneficial for transitioning into 3D, particularly if you plan to work in graphics programming. But I’ve seen folks begin programming in 3D and pick it up exactly as quickly as the other students did.
In conclusion, 2D game creation is not necessary for 3D game production (but more experience never hurts!).