Phrase used to start a sarcastic comment or response. It can also be used on its own to imply sarcasm in different contexts. It's basically used to mess around and joke with your friends, but it can be mean if you want it to be.
Acquaintance: Hey man, do you wanna hang out tonight?
You: Yeah dude, I like you.
Teacher: Your final grade will be based on one 15-18 page paper.
You (to friend): Yeah dude, we're gonna pass this class, right?
Man: Will you marry me?
Woman: ....yeah, dude.
Bro: Dudeeeee you tryna blaze tonight??
You: Yeah dude, I don't have work tomorrow morning or anything.
Friend: Dude could you do me a favor and get me a drink?
You: Yeah, dude! (you don't get the drink)