YES it can . Web pages are checked by "spiders" and "crawlers", then depending on how your page is evaluated it gets ranked somewhere on the search engine. Search engine spiders need to interpret your HTML. And while browsers are very forgiving of HTML errors, search engine spiders aren't nearly as forgiving. The spider needs to figure out what you're saying before it properly can index your page. Search engine spiders care about the structure of your Web page because they give extra weight to keywords placed inside certain HTML tags.
Valid HTML is important if you want to ensure a good search engine ranking. It also helps guarantee that your page will be displayed properly.
PM Photo validates all web pages using the latest W3C validator as well as other methods of checking the web page code to assure compliance.