To the extent Constitutionally permitted or as further limited by the state’s own law
Constitutionality, a suit may be brought (or a prosecution launched) when the state has personal jurisdiction over the defendant.
… a state court may only exert personal jurisdiction over an individual or entity with "sufficient minimal contacts" with the forum state such that the particular suit "does not offend 'traditional notions of fair play and justice.'"
What constitutes sufficient "minimum contacts" has been delineated in numerous cases which followed the International Shoe decision. For example, in Hanson v. Denckla, the Court proclaimed the "unilateral activity of those who claim some relationship with a nonresident cannot satisfy the requirement of contact with the forum State. The application of that rule will vary with the nature and quality of the defendant's activity, but it is essential in each case that there be some act by which the defendant purposefully avails itself of the privilege of conducting activities within the forum State, thus invoking the benefits and protection of its laws."
For the abortion bill, an organisation that provides funding to Texas residents probably has “minimum contacts”, an out-of-state doctor who treats all-comers probably doesn’t.
For employment laws: if the employee is based and work takes place in the state, yes.
There is a separate question of which state's law applies which is independent of which state's courts can hear the case. A California court can decide that it can hear a case according to Texas law for example although, in practice, if the California court felt that all of the issues were Texan, they would probably decide they lacked jurisdiction.