Both input and output impedance are quantities that you can often look up in the datasheets of a single component, figure out yourself for a transistor amplifier circuit, or even measure yourself.
The ideal op amp — which we can’t get — has infinite gain and infinite input impedance. While we can’t get that in real life, modern devices are good enough that we can pretend like it is ...