How safe is it to swallow a few lego pieces (the 4x2 kind)?

Why. An object that size can have risks of choking and is unsafe. Are you asking what if a toddler accidentally swallows lego pieces?
I don't recommend it. Any foreign ingestion can catch in the swallow tube, blocking fluid & food intake. That might require retreival in the or. If it makes it into the stomach it may pass thru the gut within 3-5 days. I wouldn't expect lego's to show up on xray unless the company put something in the plastic for this reason. Feeding the kid stewed okra soon after the ingestion can wrap it up & smooth passage.