In fact, yes.
However, depending on your language, an “interface” may have a certain meaning. A factory usually returns a specific implementation of a general contract - which may be an interface, a base class, or any other means of specialization.
In addition, there are times when the factory returns the exact type that you specify, but you use the factory for other purposes, such as managing lifespan, tracking, or other justification, other than creating a specialized type.
source share