Would think it depends on what you do at the gym.
Most major core exercises (squat, bench, deadlift, overhead press and row) involve tightening of your stomach muscles to help protect your spine and activate your whole body into the exercise. Having a plug inserted is likely to interfere with this and put your body at risk of injury (imagine a butt plug shooting out at the bottom of a squat, would be hard to recover from that in the weight room).
If you park on a treadmill / bike / rower / stair climber etc for the bulk of your workout, then you could probably get away with it if desired, I wouldn't go wearing tight pants though, the base may become quite visible.
So long as you don't risk injuring yourself, its your backside, have at it.