DDOS? Blacklisting by spam monitors? Bad neighborhood issues?
The only "safe" approach to IP addressing that I can conceive of is to have lots of them on different blocks, but if you're geotargeting that could be a problem in some cases.
Plus there's all the other factors that SEs look at, like WhoIs info (or absence thereof), creation dates, same registar for domains of X date, interlinking, . . . down to rat-out reports from competitors in your favorite SERPs.
I've heard that if i put a site A on the IP which is used for ns1.maindomain.com then going to ns1.maindomain.com would show that site A too. Can this hurt site A? Can this trigger some duplicate content penalty?
This outcome would likely require a combination of webserver settings plus DNS settings. In other words, if the webserver was configured to serve a default website and the webserver using a shared IP address was not properly configured to serve the "other site" then the webserver might serve the default site if someone typed in the "other site".
"Host headers" is a topic you might explore if it's an IIS server.
As to duplicate penalties few can say exactly how a specific outcome will be processed, even with a lot more detail than you should care to post here (forgetting for the moment that it's against the TOS and Charter).