Is it legal to barrel roll a plane? Are you allowed with any pilot license? Are there any requirements for the plane to be allowed to barrel roll?
Well, classic lawyer response here: It depends.
Barrel roll is an aerobatic maneuver which, at a minimum, requires the PIC comply with the legal limitations on aerobatic flight per 91.303 and 91.307.
Like any other risk management procedure on a proposed maneuver or mission, ask yourself: is it safe? Is it legal? Is it reasonable?
You are PIC - Directly responsible for and the final authority on the operation of that airplane.
What are the known risks associated with this maneuver and how can we minimize those risks?
What other mitigating factors eg MAC, CFIT, etc. can come into play here and how can we minimize them? Do we have backup and emergency contingency plans available plus time and altitude in case something goes wrong?
Are we flying an airplane which is approved for these kinds of maneuvers? Is the aircraft in good working order? What about IMSAFE to assume PIC role in aerobatic flight? What is your flight currency in both this make and model of airplane and the aerobatic maneuver?
Do we have an appropriate preflight and weather briefing for the proposed flight? Do the conditions permit safe execution of the mission during the time window of operations?
Do any of the proposed maneuvers or missions violate FARs, or other local, state, or federal laws?
Is the execution of the mission at the proposed place, time and with the planned personnel and equipment reasonable or prudent? Is there any aspect here that while conforming within safe and legal limitations of airmanship would make this unnecessarily risky?
If any of these are in doubt, don’t fly. You can be held legally liable under 91.13 Careless and Reckless Operation otherwise.
A barrel roll is a safe, 1G maneuver WHEN PROPERLY EXECUTED and has been performed many times in all types of airplanes. The ability to do so depends on the aircraft type, pilot’s skill, and time and place.
Many airshow and test pilots have barrel rolled all types of aircraft - the late Bob Hoover and Tex Johnson quickly come to mind. Keep in mind though, those guys were crazy skilled aviators with thousands of flight hours plus plenty of close calls where they quite frankly scared the s@*t out of themselves and escaped death by a hair’s breadth. Plenty of other people weren’t so lucky and dug a smoking crater.
This answer is for the US. A parachute is required of everyone when the aircraft is carrying someone who is not a crew member. The maneuver must not be prohibited by the aircraft flight manual. (Or must it be specifically permitted?) (Future edit needed.) And of course you must not exceed the permitted airspeed and G-load parameters.
There is no relation to the license (certificate) the pilot holds.
Actually, this related answer indicates that the airplane or glider must be in the "acrobatic" category: What are the US definition and restrictions on aerobatic flight?. But it's not clear what specific FAR is involved, if any.