Is it possible for a container to have it's own ufw rules?

I’m new to docker but wanted to try it out at home. I have set of ufw rules on the host but would like a different set on the container is it possible to accomplish this without affecting the host?