Is it legal to carry medical oxygen on an aircraft for a passenger?
FAR Part 135.91 notes that medical oxygen containers - whether for the storage, generation, or dispensing of oxygen - must be:

135.91.a.1.i Of an approved type or in conformity with the manufacturing, packaging, marking, labeling, and maintenance requirements of title 49 CFR parts 171, 172, and 173, except §173.24(a)(1)
135.91.a.1.ii When owned by the certificate holder, maintained under the certificate holder's approved maintenance program;
135.91.a.1.iii Free of flammable contaminants on all exterior surfaces; and
135.91.a.1.iv Appropriately secured.
135.91.a.2 When the oxygen is stored in the form of a liquid, the equipment must have been under the certificate holder's approved maintenance program since its purchase new or since the storage container was last purged.
135.91.a.3.i-ii When the oxygen is stored in the form of a compressed gas as defined in title 49 CFR 173.300(a) When owned by the certificate holder, it must be maintained under its approved maintenance program; and The pressure in any oxygen cylinder must not exceed the rated cylinder pressure.
135.91.a.4 The pilot in command must be advised when the equipment is on board, and when it is intended to be used.
135.91.a.5 The equipment must be stowed, and each person using the equipment must be seated, so as not to restrict access to or use of any required emergency or regular exit, or of the aisle in the passenger compartment.
135.91.b No person may smoke and no certificate holder may allow any person to smoke within 10 feet of oxygen storage and dispensing equipment carried under paragraph (a) of this section.
135.91.c No certificate holder may allow any person other than a person trained in the use of medical oxygen equipment to connect or disconnect oxygen bottles or any other ancillary component while any passenger is aboard the aircraft
135.91.d Paragraph (a)(1)(i) of this section does not apply when that equipment is furnished by a professional or medical emergency service for use on board an aircraft in a medical emergency when no other practical means of transportation (including any other properly equipped certificate holder) is reasonably available and the person carried under the medical emergency is accompanied by a person trained in the use of medical oxygen.

Part 91 does not seem to speak to medical oxygen
Additionally, a page on the FAA website notes that:

In the DOT final rule, section 382.133 generally requires that air carriers conducting passenger service must permit someone with a disability to use an FAA-approved portable oxygen concentrator (POC) on all flights (on aircraft originally designed to have a maximum passenger capacity of more than 19 seats) unless the device does not meet applicable FAA requirements for medical portable electronic devices (M-PED) and does not display a manufacturer’s label that indicates the device meets those FAA requirements.

The page goes on to list approved oxygen containers. So, it seems that the FAA does not consider POCs to be hazardous, so long as they meet certain FAA approval standards. (If you are asking about General Aviation requirements, I would assume an FAA-certified POC is okay to bring on a GA flight as well)