L1 extension rejected

Hi,

My L1 extension got rejected. I hold a B1 visa. Can I travel with my husband who holds H1B and apply for H4 from USA? Would that be illegal?

Legally, you can do it but I do not suggest it as filing a change of status within 90 days of entering can be flagged as fraud and investigated. If you go this route, make sure to file the change of status after 90 days.
I am guessing you want to do this as you are not finding H4 stamping appointment? You may qualify for dropbox.