I've kept bamboo in my HOB filter. It grew great in there.
Depends on what fish you have. If you have a lot or a few with bigger bioload then dont take your 40g filter away. If there's no fish or smaller fish with lower bioloads then go for it.
Personally I think it's fine in a little planter. Just keep it away from too much light or the leaves will start to brown.