When you play games on Steam you can get Trading Cards in the games that have this option.
Can we obtain the same trading cards from just playing the game demos of games that would have trading cards?
No. If they allowed this, it would be abused by people with multiple accounts.
For this same reason, you cannot get cards for free-to-play games without purchasing something first:
What about free to play games like Team Fortress 2 or Dota 2?
Free to play games drop game cards based on your in-game purchasing. For every $9 USD spent (approximate) since the start of the Steam Trading Card Beta, you will earn one card drop.