I'm particularly interested in the context of current WGA/SAG-AFTRA strike in the US, but this is a general question. If some business amid a union strike would terminate its agreement with a union, can it lay off the striking union members and hire non-union workers in their place? Are there any legal reasons they can't do that?
It depends on the nature of the strike. If a strike is "protected" (allowed under the NLRA), you cannot be fired but if the strike is illegal, you can be. If the strike is legal and was at least in part over an unfair labor practice, you must be immediately reinstated after the strike ends. If the strike is over economic issues, you might have been replaced with a permanent employee so you are placed on a preferential hiring list. However this right to reinstatement can be lost if you engage in serious misconduct in connection with the strike or picketing.
A business cannot unilaterally terminate a collective bargaining agreement (the "Contract"), nor terminate a union's representation of its members.
A business may hire non-union employees to work during a work stoppage ("strike"), or may have exempt (management) employees perform the duties of the striking employees. The union employees must be re-hired after a legal strike is over. Caterpillar famously employed these tactics during a 17 month strike in the 1990s that was disastrous to the striking workers, who were forced to agree to significant concessions to end the strike.