Does email (like gmail, yahoo, hotmail) providers block domains?
Or do they mainly block IP addresses?
I'm wondering...what if people use my domain to spam others?
Then it would be unfair to me right?
Spam blockers are a combination of both. The most common is by IP addresses using a RBL. The second is domain-level blocking if there's tons of spam coming from your domain.
As noted in the comments, using proper DNS entries and DKIM entries will ensure your domain is relatively "safe" from being blacklisted on certain sites since spoofed mail will fail SPF tests.
Almost all email servers maintain both IP and DNS blacklists. If you check out a site such as www.blacklistmaster.com, which lists different black lists that email server administrators can opt to use - you can check for blacklisting by both IP and domain name. Spamhaus (the main (most known) blacklist provider, that Yahoo & AOL use) maintains both IP based and DNS based blacklists.
DKIM & SPF cannot stop people from using your domain, if they wanted to, but it came provide evidence that your domain had nothing to do with the spam making it much simpler for you to get your domain unblacklisted if that ever happened.