How do I override the material of an object in a view layer? How can I do the following?

There are 2 objects in my scene. Object A and object B. I want to create such a view layer where object A has another reflective material (override) and object B is visible only in reflections of object A. It is possible in two clicks in another software, but is it possible in blender ?
do you want an object being seen only through the mirror basicly? then you need to moove an object to a different collection but at same layer and press the icon shown on the screenshot (if the symbol is missing you can turn it on in the filter)