In the game, you receive the hidden blade after speaking with your father Giovanni and then with Leonardo, who repairs it using a Codex page from an earlier memory. Press X to deploy it when you are not locked onto a target.
In real life, yes, a working version is possible, and there are two plausible mechanisms.
The first is a locking wrist mechanism: flick the wrist and the blade extends, locks into place, and retracts on a second movement. The second uses a grip that comes to the hand, where squeezing a lever releases the blade. The first is how it works in Assassin's Creed.
People have built both. The spring-and-lock designs are the more common, and they are genuinely functional rather than decorative. They are also, obviously, a bad idea to carry anywhere in public, since a concealed spring-loaded blade is a weapon in the eyes of the law regardless of how it is mounted.