What happens if a voltage is applied to the gate of a MOSFET when both drain and source are shorted?
Assuming you stay within the rated voltage limits, there is no problem shorting drain and source. All you're doing is shorting out the channel resistance. Gate current is a function of Vgs/Vgd, but in most applications it will be negligible. The device is useful in this configuration as a capacitor.
For your second question, the capacitance will be a function of the (shorted) s/d voltage. You can make use of this property to digitally trim a capacitance. By driving digital trim bits into the s/d of weighted FETs configured this way, you can alter the total capacitance (to small-signal ground) on some node.