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:
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.