In what cases we use unions in verification.?

To start, I would suggest reading a few previous posts on the forum, for example:

Additionally, I recommend reading some examples of union usage in System-Verilog available on the web.