Multiple H1b transfers

I got laid of company A(i94 expiry 2020) and transfer to company B (on recpiet notice )and the had to transfer to company C within four months.

Company B h1b got revoked

company c is in progress but again company C job is going to end.

If i get some offer in company D can i transfer/ What will be risk associated with it ?

Legally you can transfer to company D. There is no risk. But USCIS may give you a RFE asking reason for so many changes.