Convert the percentage to a fraction. For instance, $20\%=\frac{20}{100}=\frac15$. To get $20$% of the apples into the bucket, you need to put one-fifth of them into the bucket, so every fifth apple should go into the bucket. In general, if the percentage corresponds to the fraction $\frac1m$ for some integer $m$, you want to put every $m$-th apple into the bucket.
It gets messier when the percentage doesn't correspond to a fraction of the form $\frac1m$. Suppose, for instance, that you want to end up with $30$% of the apples in the bucket. $30$% is $\frac3{10}$, so you need to put $3$ out of every $10$ apples into the bucket. You can simply do it: $3$ apples into the bucket, then $7$ out of it, then $3$ into it, then $7$ out of it, and so on. There's no way to get it exactly right putting one apple into the bucket, skipping a fixed number, putting one apple into the bucket, skipping the same fixed number, and so on. The closest you can come is a sequence like this, where the red apples go into the bucket:
$\color{red}{\text{O}}\text{O}\text{O}\color{red}{\text{O}}\text{O}\text{O}\color{red}{\text{O}}\text{O}\text{O}\text{O}|\color{red}{\text{O}}\text{O}\text{O}\color{red}{\text{O}}\text{O}\text{O}\color{red}{\text{O}}\text{O}\text{O}\text{O}|\color{red}{\text{O}}\text{O}\text{O}\color{red}{\text{O}}\text{O}\text{O}\color{red}{\text{O}}\text{O}\text{O}\text{O}|\color{red}{\text{O}}\cdots$
That does put $3$ out of every $10$ into the bucket, or $30$%, and it almost does it with a regular spacing, but not quite.