Yes you can, but sometimes you don’t have to! If you just want to do some rapid prototyping or try something out without setting up a whole project, plus Git and everything, CodePen is just perfect! It’s straightforward, one click and you are ready to go.
But as soon as you know, that it’s going to be a bigger thing, i would recommend to use version control with Git where you can go back if needed.
And if you start adding Backend Stuff or messing around with Cross-Origin requests, CodePen will not fit any longer.