Maybe. You’ll need something to filter on top and bottom to keep the pellets from escaping the bottle. The pellets need to gently swirl around and bump one another to be effective, I’m not sure how well your setup will work.
When pellets first became the rage I made a simple setup for a biocube back chamber. I used an MJ400 friction fit into a hole in the bottle lid, with a piece of thin filter foam in the neck to keep the pellets out of the pump during power outages. Above that was the pellet chamber and topped it off with a piece of fiberglass window screen attached with rubber bands. The bottle simply overflowed the top and the effluent went into the next chamber holding the skimmer. That was the best diy I came up with, I wouldn’t do it again. If the need to run pellets arises again I’ll buy a reactor and be done with it.
Let us know how it turns out, DIY and tinkering are some of the best aspects to this hobby!