1) Yes, if your 21-inch iMac has a Thunderbolt port (2011 models and newer). The Target Display mode only works when connecting with a Thunderbolt cable (not a mini Displayport cable)
After connecting the two Macs with the TB cable, then just hit Command + F2 on the iMac keyboard to set it to Target Display Mode.
2) Yes, you just need the right adapter.
Apple has no idea what you want to connect to, so the video adapters are just that - adapters, only a few inches long. You then just add the cable in the length that you need.
The adapter can be this one - Mini Displayport/Thunderbolt to HDMI
Or, a great site for lots of different cables is Monoprice.com - and here's a link for a variety of cables, both short adapters, and multiple lengths to get just what you need.
You can see that there's several choices