I've never heard that it's illegal, not sure why it would be. It's always a good idea in case one brokerage is having technical problems and you're in a position that you would like to get out of. You can always just short it in the other account.