I would say the location of your web hosting server would affect your websites ranking.
Like if you're targeting USA visitors your web hosting server should be located in the USA and not in some other country.
But the difference in hosting your website on a dedicated hosting server vs shared hosting server I doubt has any affect at all.
Just make sure your website loads fast and has good up time as downtime and slow loading websites can affect your SEO ranking.