This means "That's not true!" or "That's a silly thing to say!" The word "nonsense" means something that doesn't make sense or doesn't have any meaning.
One situation where people often say "Nonsense!" is when they're reassuring someone who's speaking negatively about themselves. For example:
A: It's so hard to meet people. I feel like I'll never find a boyfriend.
B: Nonsense! You're so awesome. I bet there's tons of guys who'd love to go out with you.