Yes it is possible, but it is recommended to sow directly in the ground.
Most sunflowers that grow in pots are dwarf varieties unlike mammoth sunflowers, which can grow 8-12 feet tall. Because of their massive size, mammoth sunflowers would need pots at least 5 gallons in size. Growing conditions aren’t optimal in a container so the plant may not reach its full potential in height, but it will still grow.