If a company that is in a state where weed is illegal buys a company in a state where weed is legal can they drug test for weed and punish if tested positive?

Company policy is what you have to abide by if you want to be employed by them. So they can fire you if you violate their rules. But you can’t be charged with a crime, like if you stole a computer, or beat someone up at work.