You can laugh at whatever you want.
But then am I a racist if I do laugh?
The only thing I know is
1) a person told you a joke
2) that person has been somehow identified as Mexican
3) the content of the joke (which includes a Mexican element)
4) you found it funny enough to laugh at
If this was my only encounter with you I would personally keep that information in mind if I had to interact with you again to see if I could put it in more context. If I already knew you then I would put in that context.