From the context of the question and the assumption that your experience level is low, this applies if you installed Ubuntu using the wubi
(Windows-based installer) which installed to a single file in your Windows partition and is used as a disk image.
If this is the case, a Windows defrag will likely either move this file to a more efficient area of the disk (in tact and as a complete file) or it will move the other files around it - whichever will result in less fragmentation. So no, your Ubuntu install will not be affected.
Refer to @roadmr's answer for the second part - you do not need to defrag your Ubuntu partition
Furthermore, if your disk is an SSD, defragmentation is unnecessary regardless of operating system because it is done by the controller automagically.