To answer your question shortly: You can (technically) but you shouldn't.
You have a lot of option here, but the real questions are:
- do you want a portable development environment?
- do you want to quickly go back and forth between Windows and Ubuntu? Maybe accessing Windows files from Ubuntu?
If you want portable, then you your options are:
- install full Ubuntu on a pen-drive: This is the cheap way, and it will be useless, and very frustrating to use. If you haven't spent an insane amount of money on that pen-drive, it will be slow for random reads, because only sequential reads are fast on an average pen-drive. Second, wear-leveling is not working great on a pen-drive, meaning it will fail very soon. Third, you have to tweak the hell out of any Linux distro to not write to the pen-drive 5 times a second even with EXT2 filesystem, and this gets you back to wear and slowness
- install Live Ubuntu on a pen-drive, with persistent data storage. That is an almost good solution, I used it for a while: This version of Ubuntu is designed to run from CD, so it is prepared not to write to the medium it is loaded from. Some clever guys tweaked it to pen-drive usage, so it can store some data (I used it on a 16 Gb Sandisk Cruzer Micro). It is still slow to load, but then it is fine. Try Wubi to install Ubuntu to the pen-drive, it will even download the specified distro for you.
- Invest in a small external SSD (about 32 Gb will do) with USB. You will get very fast speed and good wear-leveling. Here you can choose whether you want the full or Live install. I suggest full install.
Any of these solution is good for direct boot, or you can boot all of them into a virtual environment, like VirtualBox.
If you don't want to be portable, you have 3 options, but only one is viable:
- install Ubuntu as a second OS on a different partition.
- install Ubuntu as a second OS as a single file inside Windows.
(These two are pretty much useless. you have to reboot to get into Ubuntu.)
- Install Ubuntu in a virtual environment, like VirtualBox or VMWare Player, both are free.
And the isolated/portable combo:
- boot into the live/full Ubuntu through Virtualbox,
I suggest to NOT store VirtualBox's .vdi file on the pen-drive/SSD and use it from there because you will be tied to VirtualBox while the previous method will allow you to decide how you want to boot it.