Set a custom field to all orders

You can achieve this via the save_post hook as per the following example:

function wpse_374688_save_post( $post_id, $post, $update ) {
    // only update orders (post_type=shop_order)
    if ( 'shop_order' !== $post->post_type ) {
        return;
    }
 
    update_post_meta( $post_id, 'activecampaign_for_woocommerce_accepts_marketing', 1 );
}

add_action( 'save_post', 'wpse_374688_save_post', 10, 3 );

This callback will run each type a post_type of any kind is saved and or updated in some form. In the above example we check the post_type to ensure it is a shop_order, if not, we bail early.

If you want to ensure that all orders have this set to true (1) no matter whether saving or updating then you can leave the code as is. If you only want it to run on update then make use of the $update variable which will be true or false depending on whether this is the first save or a subsequent update.

As a tip you may want to check the status of the order and whether or not certain types of orders should have this value set to true (1) such as cancellations/refunds, but that is entirely at your discretion.