Dimmable optical orthogonal frequency division multiplexing (D-OFDM) is challenging to design for visible light communications, due to the high peak-to-average power ratio (PAPR) of OFDM signals and limited dynamic range of LEDs. Current D-OFDM schemes focused on the time domain and spatial domain designs of OFDM signals. This paper proposes a novel dynamic subcarrier activation based OFDM (DSA-OFDM) scheme. In DSA-OFDM, the number of activated subcarriers, as well as the signal's DC bias and the number of activated LEDs, is adjusted to provide both flexible dimming control and reliable communication. A generalized index modulation in both spatial domain and frequency domain is designed to select the activated subcarriers and activated LEDs. To show the influence of frequency domain design analytically, the closed-form expressions of the PAPR and the clipping noise of the DSA-OFDM signals are derived, and the optimized signal form is obtained accordingly. Simulation and numerical results show that the proposed scheme can outperform conventional dimming control schemes at various illumination levels in terms of the bit-error rate performance.