If you really, really want to use only the firewall, your best bid is to copy/paste this list manually in your firewall since this is your only option of blocking adult-content from Firewall!
As other may have advised, OpenDNS, is good option regarding different packages of filtration. Note, some have reported that openDNS does not always provide the best filtration of adult contents.
If it is possible to block all such sites and contents such as videos and Images from my PC then please tell me the method.
Yes, but not with firewall. You either need a browser plugin or To be able to block every adult-content, videos, pictures etc...You need third-party application that have maintained databases of this type of content, it will take care of that for you automatically, 3rd-party will have responsive collection of updated database that contain all of this on regular basis done for you.
Please also tell me how to do the same in Ubuntu 16.04.
Same follows to other OS's, you need a database of the content or domains you're trying to block, there is no easy,fast way around this with firewall only!
*I do not want to use any third party application for Windows and Ubuntu other than firewall.
Then add this list provided in your firewall, it is tremendous amount of domains, you can take that to the next level and start to build your own customized firewall.