It is ILLEGAL for a F1 student to work off campus. No matter what you have heard, it is ILLEGAL. It is extremely dangerous and risky to work off campus to make a few dollars. Some universities have certain research centers or offices that may be distributed around the town, away from the main campus. This means those buildings are physically located at other places but are still part of the university. Working at such centers is fine because you are still working for the university, on the university premises.
Several students do not understand the difference between working at a food court on campus and off campus. While working for pizza hut at a food court located on the university grounds is legal, but working for the same unit off campus is illegal.
The rule of thumb to define legal is to take note of your paycheck. First up, you should be getting your earnings in the form of a paycheck and not cash. Second, the paycheck must be cut by the university payroll services. If you have checked these two things, then you are working legally under the rules of your F1 visa.
Students who are caught working illegally are typically deported and their visas are revoked. They will find it extremely difficult to come up to the US (no matter which visa they choose).