As always it depends on the child.
If they are just 2 I'd say wait a year but at nearly 3 they should cope OK.
Prepare them for it being loud, dark and a bit scary at times. If their attention span isn't too good you might want to have enough adults in your group to allow you to leave with him at the interval. At nearly 3 my DD was fascinated with trips to the toilet (potty training and panto don't really mix

but she enjoyed the show.)