If I buy and install the Heart of the Swarm expansion, can I still play multiplayer games with people who have Wings of Liberty? or am I limited to HotS matches only?
Under Gameplay in StarCraft II's options menu, you can set the expansion level between Wings of Liberty, Heart of the Swarm and the upcoming Legacy of the Void expansion. If you set it to Wings of Liberty, ranked ladder and unranked matchmaking as well as bot matches and anything else will be with the Wings of Liberty features and Wings of Liberty players only. For example, Void Rays in matches played with Wings of Liberty selected will still have their focused damage increase. (In Heart of the Swarm, this was removed and replaced with an ability.)
For playing with friends who only have Wings of Liberty, you can leave your expansion level on Heart of the Swarm. When you are in a party with someone who doesn't have Heart of the Swarm, it will have an icon in the party chat beside their name saying that they only have Wings of Liberty. In the matchmaking section, it will say "Playing Wings of Liberty" in the bottom right. When you begin matchmaking, you will be matched with others who are playing Wings of Liberty and with Wings of Liberty units, abilities, maps and stats.
In short, yes: when a friend with only WoL is in a party with you, you can play with them and you will be playing with the WoL content.