Can I make a joke about my significant other's mother farting during dinner?
Why do you intend on doing that?
I just wanna be this "cool" boyfriend doing some stupid thing
While I feel like being funny towards your in laws can be sometimes lighthearted, making crude jokes about them may be very inappropriate. If I were you, I would gauge whether her mother would be open with you doing jokes on her behalf, and if she will not be humiliated about it.
It's fine it's not like she's going to find out.
Your joke will be heard by everyone and you will look and feel foolish for being rude.