Yes, it is done that way a lot. Not as efficient though as already mentioned but it does work if you find a place with a medium flow so it passes through the media bag without agitating the media too much so it does not grind itself to dust. I have placed it in bags in my modified Aqua Clear HOB refugium on my 16G nano for years.
Carbon definitely but GFO should be in a reactor so that it is fluidized. Up until this tank in a bag is the only way I ever used carbon. But like others have said you can do GFO in a bag just not as efficient.