On the class group and the local class group of a pullback