To flex means to boast or show off about something. The phrase 'weird flex but ok' is said when someone proudly boasts or brags about something that most people would find either awkward, irrelevant or just plain weird. It's usually stated in a dismissive fashion.
Girl 1: "I'm dating my firend's dad, if we ever get married I'll become her stepmom!"
Girl 2: ... Weird flex but ok.
Person 1: "Yo, I finally hooked up with my cousin on Thanksgiving."
Person 2: ... Weird flex but ok.
It means that your acceptable weird. Some people are weird, but it's like dorky weird. People who are weird in a good way are not dorky but they have their own style, they're not scared to be themselves, and they stand out as different in a good way. Overall it's a complimentfor the most part.