Yup
Last year I ran out of room and got a great big pot that had had a tree in it, filled it up with well rotted manure and plonked the courgette plant in it.
It was doing wonderfully well until a car ran into the allotment in August and smashed it to pieces.
You can grow both on a compost heap if you need to.
If you are using a big pot then put it where you need it before filling it up because once it is full you wont shift it.