Yes, but it is not easy, particularly if you are using a theme that hasn’t been designed with this in mind.
https://discourse.gohugo.io/t/site-looks-fine-on-localhost-and-github-pages-but-not-when-rendering-to-public/35825/2