This is almost always true, but not quite. You can apply in some cases when B is a proper class (and even if A is a proper class), but you can't take the power set of a proper class so is not a valid statement. For example, it makes sense to say that the class of all ordinals form a subset of the class of all sets, and I can describe this in first-order logic without getting into paradoxes. However, it doesn't make sense to refer to the power set of the class of all sets (such a set does not exist).
The important idea here is that the power set of a set X, is the collection of all X's subsets. So the members of P(X), when P(X) is a set, are precisely those things that are subsets of X.