Certified GKH Gardening Expert
This is tricky. You can but they will require yearly care, such as fertilization and repotting, or even cutting lower roots to keep in a certain size container.
As long as you are willing to give them the care that they require then it is completely possible to grow and yield fruit in container.
This article will help: https://www.gardeningknowhow.com/edible/fruits/pomegranate/pomegranate-in-a-pot.htm