Rules are in section 18.2.
AFAIK, unit does not have to exit bunker.
From rules, enemy unit may enter bunker at no additional cost, so no reason not to move into bunker when enemy CCs. Only defending unit gets benefit of bunker defense. From this strict reading, if you attack the enemy they would get bunker defense even though you occupied the bunker at start.
From 18.2 "Units may occupy empty or friendly
fortifications when moving into a hex at no additional cost."
A soviet unit is inside a Bunker(the bunker is not empty and not friendly to the german). An adjacent german unit move inside the Bunker hex(cannot enter bunker). Then can the soviet inside the bunker attack the german unit or does it have to get out of the bunker?
Having rechecked the rules, I guess that they can.