For a cross examination, can you question a witness about someone else's testimony?

Usually not, but there are exceptions.

for instance A stated that B told him...xxxx.
B can testify that indeed it did,or did not happen.

Yes, during a cross-examination, you can question a witness about someone else's testimony. This is known as "impeachment by contradiction." It involves challenging the witness's credibility or memory by highlighting differences or inconsistencies between their own current testimony and any previous statement they made, or by referencing another witness's testimony that contradicts theirs. Here's how you can do it:

1. Prepare: Review all available evidence, including witness statements, deposition transcripts, previous testimonies, and any relevant documents to identify any inconsistencies or contradictions.

2. Establish foundation: Lay the groundwork by confirming the witness's knowledge or familiarity with the person whose testimony you wish to bring up.

Example: "Are you familiar with the testimony given by Mr. X in this case?"

3. Present the contradiction: Point out the disparity between the witness's current testimony and the statement made by the other person.

Example: "Mr. X testified that the incident occurred at 4 PM, while you claim it happened at 5 PM. Can you explain this discrepancy?"

4. Challenge credibility: Question the witness about their memory, consistency, or any potential bias that may influence their testimony.

Example: "In your previous statement, you mentioned that you were unsure about the events, yet today your memory seems quite clear. Can you explain why your recollection has changed?"

5. Cross-reference statements: If another witness contradicts the current witness's testimony, ask them to acknowledge the differences.

Example: "Ms. Y testified yesterday that she saw you in a different location at the time you claim to have witnessed the incident. How do you explain this inconsistency?"

6. Follow up with questions: Utilize follow-up questions to further explore the contradictions and potentially weaken the witness's credibility.

Remember, the specific rules and allowances for cross-examination may vary depending on the jurisdiction and legal system involved. It's important to consult applicable laws and regulations to conduct a proper cross-examination.