You can, there are multiple ways to achieve what you want. If I understand correctly you want to build a web server in OCaml and a web app front end. Here’s a list of what different projects used:
Edit: To elaborate because I realized I didn’t answer your question, typically you’d have a frontend which uses something like rest or graphql to fetch data from your server. There’s a lot to unpack here. I’m sure you’ll be able to pull it off but if you’re not comfortable with programming make sure that you approach the problem gradually and make sure to avoid analysis paralysis.