Technically, yes. It is illegal to walk around with an open container of alcohol in Mexico. But where and how this law is enforced is inconsistent. In more touristy destinations such as Playa del Carmen, no one is going to bat an eye at someone walking around with a margarita or Modelo.