Sure, but there’s a lot of work involved. You have to put up the form, get the responses, sanitize and validate them, then mail out and/or save the response. It’s a whole lot easier to use a plugin for that. (My preference is Formidable.) There’s nothing wrong with using plugins.
If you want to go the “roll your own” route, check this tutorial:
https://premium.wpmudev.org/blog/how-to-build-your-own-wordpress-contact-form-and-why/
]]>