I actually want to buy a D bamboos flute but I would like to know whether I can use it to play other keys as well
You’ve not really provided enough information, so I’m going to assume that it’s a keyless flute and also that it’s been made as a musical instrument rather than a toy or a tourist knick-knack.
If it’s a D flute with six finger holes and D being the note sounding with all holes closed, you can easily play in D, G, and (with a cross fingering) A. Playing in C will require you to cross-finger the f note - xxxx0x might produce a passable f, or maybe xxx0xx or xxxxv0 [where x is a closed hole, 0 is an open hole, v is a half-closed hole, your mouth is at the left hand side].
So it’s doable, but you’re going to need to practice practice practice, and the f note might be weak so try to avoid tunes that emphasise the f if possible.
For a versatile approach I would recommend a recorder instead. The ones out of plastic are comparatively cheap even from well known brands.
This assumes your choice was due to price; if you like the sound, you have to stick with appropriate pieces or become expert in transposition, either in real-time while playing or with notation software.