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.
You also are unable to get cards from "Free Weekend" type games. ORION: Dino Horde let users play the game for free for an entire week. I played for over 3 hours and received no cards. The badge showed up on my "Badges" list but said "No Card Drops Remaining".
Essentially, to get card drops you must either purchase a game or, for Free-To-Play games, purchase items from the game store.