Well, they're both prepositional phrases, which doesn't help a ton, but just for grammar's sake. It's all about the position of the objects (or subjects) of the sentence, and their relation to the corner. Someone on Quora said: "In the corner” is about placement and “at the corner” is about location." You can say at/on the corner" usually if you're giving directions or "in the corner" if you're talking about position. Like anything in English, there are no hard and fast rules, just guidelines. Another tip: most of the time, it's helpful to think on/at the corner = Outside, in the corner = Inside. If it helps, I can give some examples:
She was standing at the corner of Yonge and Dundas. (Here, Yonge and Dundas refers to an intersection of two streets.)
Lily's car was waiting for us on the corner. (Here, "on the corner" can refer to an intersection, or any rounded edge of a street,)
Sam threw his bookbag in the corner of the classroom. (This is inside, and Sam is throwing his bookbag where two walls meet in a room.)
I told the naughty toddler to go sit in the corner. (Again, this is a point where two walls meet, and something/someone is going there.)
I carefully placed the mug on the corner of the desk. (The cup is "on the corner", still positionally, but it seems to break some of the rules.)
As you can see, there are some exceptions, but the inside/outside rule usually applies. Hope that was helpful!