You can build, and test, the projects in VS Code. However, in order to submit them, you would need to publish the code in some way.
That way could be copy-pasting to CodePen, setting up a GitHub Page with the code, or purchasing a domain to host the code.
I would suggest writing the code fully in HTML on VS Code, then Copy-Paste it to CodePen in the HTML section.
When you build the project, make sure to include the necessary code: https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js
This way you can test it.