How to restrict anonymous users to a single product and quantity 1 using Commerce and Rules?
These rules can be used to restrict number and quantity of products available by role.

They can be imported in Rules admin.

Restrict to single product:

Basically, before adding to cart, if anonymous, remove existing products from cart. The effect is only the latest product is added to the cart.

{ "rules_single_product_order" : {
    "LABEL" : "Single product order",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules", "commerce_cart" ],
    "ON" : [ "commerce_cart_product_prepare" ],
    "IF" : [
      { "user_has_role" : {
          "account" : [ "site:current-user" ],
          "roles" : { "value" : { "1" : "1" } }
        }
      }
    ],
    "DO" : [
      { "commerce_cart_empty" : { "commerce_order" : [ "commerce_order" ] } }
    ]
  }
}


Restrict quantity to 1:

On order presave, if anonymous, loop over the line items and set quantity to 1

{ "rules_restrict_quantity_to_1" : {
    "LABEL" : "Restrict quantity to 1",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules", "entity" ],
    "ON" : [ "commerce_order_presave" ],
    "IF" : [
      { "user_has_role" : {
          "account" : [ "site:current-user" ],
          "roles" : { "value" : { "1" : "1" } }
        }
      }
    ],
    "DO" : [
      { "LOOP" : {
          "USING" : { "list" : [ "commerce-order:commerce-line-items" ] },
          "ITEM" : { "list_item" : "Current list item" },
          "DO" : [ { "data_set" : { "data" : [ "list-item:quantity" ], "value" : "1" } } ]
        }
      }
    ]
  }
}


Anon can still view the cart, but they will be restricted to one product and quantity of 1 - a preferable solution here. You could also show a message about the benefits of registering, if required.