Statistical properties and universality in earthquake and solar flare occurrence