Having a bad maf sensor could lead to the engine burning more fuel (running rich) and could be interfering with the O2 sensor, and over time, may even plug up the O2 sensor with crud. That's really not good for your catalytic converter. The two sensors combined give the engine metrics on how it should be running. Without them, or with bad info, the computer starts guessing and it can cause the engine to run rough.
Unfortunately, it sounds like there's quite a bit of "I don't know" going on with your story. Who was scanning the codes? Who touched the MAF sensor last? I'm guessing it wasn't. A mechanic, as those two codes would be super specific and they would have the scanners to see the live data to know which parts are acting up. More than likely, I'm guessing it was a "sensor out of range" code, which is super vague. The O2 code is likely rich or lean.
Also, check your air filter while you're fiddling around. Make sure it's clean. Unplug the MAF sensor, inspect the pins inside it and the wire for debris/ corrosion, and then seat it back into the sensor firmly.
MAF codes will clear by themselves after so many engine cycles. So you'll want to go for a 10 minuites drive or so after doing something
Worst case scenario, go and grab a MAF sensor on rock auto and install it yourself. It's probably the easiest part to replace yourself outside of your wiper blades. But you'd really like a proper inspection before you spend too much.